+ Reply to Thread
Results 1 to 6 of 6

Command button to copy and paste rows to specific cells in another sheet

Hybrid View

majana54 Command button to copy and... 07-04-2017, 07:20 AM
Sintek Re: Command button to copy... 07-04-2017, 02:34 PM
majana54 Re: Command button to copy... 07-04-2017, 11:55 PM
jindon Re: Command button to copy... 07-05-2017, 12:17 AM
majana54 Re: Command button to copy... 07-05-2017, 02:05 AM
jindon Re: Command button to copy... 07-05-2017, 02:17 AM
  1. #1
    Registered User
    Join Date
    04-09-2017
    Location
    UAE
    MS-Off Ver
    MS365 Version 2301
    Posts
    49

    Unhappy Command button to copy and paste rows to specific cells in another sheet

    Need your help please. I need a button that when it is clicked, it will copy all the rows (in this case B4:H4, B5:H5, B6:H6 etc) and paste the values in specific cells in the Template sheet. I know very little about VBA/macro. I hope someone can help me again. THANK YOU!
    Attached Files Attached Files

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Command button to copy and paste rows to specific cells in another sheet

    You don't give enough info.....What cells in template Sheet...
    Below each other....The template sheet contains 5 duplicate formats....
    paste the values in specific cells in the Template sheet.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    04-09-2017
    Location
    UAE
    MS-Off Ver
    MS365 Version 2301
    Posts
    49

    Re: Command button to copy and paste rows to specific cells in another sheet

    i wanted to copy rows 4 to 8 and paste them to specific cells in "Template" sheet.
    i.e. for row 4 in Sheet1.... Sheet1.B4 will be pasted in Template.D3, Sheet1.C4 pasted in Template.D5, Sheet1.D4 pasted in Template.D7 etc.
    for row 5 in Sheet1.. Sheet1.B5 pasted in Template.D30, Sheet1.C5 pasted in Template.D32, and so on.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Command button to copy and paste rows to specific cells in another sheet

    Sub test()
        Dim i As Long, n As Long
        n = 3
        For i = 4 To 8
            With Sheets("sheet1").Rows(i)
                Sheets("template").Cells(n, "d").Resize(12).Value = _
                Application.Transpose(Array(.Range("b1").Value, Empty, .Range("c1").Value, Empty, _
                .Range("d1").Value, Empty, .Range("e1").Value, Empty, .Range("f1").Value, Empty, _
                .Range("g1").Value, .Range("h1").Value))
                n = n + 27
            End With
        Next
    End Sub

  5. #5
    Registered User
    Join Date
    04-09-2017
    Location
    UAE
    MS-Off Ver
    MS365 Version 2301
    Posts
    49

    Re: Command button to copy and paste rows to specific cells in another sheet

    AMAZING! Thank you @jindon!

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Command button to copy and paste rows to specific cells in another sheet

    You are welcome and thanks for the rep.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Using command button to copy cell contents and paste to different sheet, then clear cells
    By Ethanrholt in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-24-2015, 10:20 AM
  2. [SOLVED] Command button to copy cells from one sheet and paste in second sheet
    By waratdenison in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-22-2014, 02:53 PM
  3. [SOLVED] copy selected row and paste it to another sheet command button vba
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-22-2014, 03:22 AM
  4. Button to copy specific cells to another sheet, lock button if cell has text
    By elmerg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-14-2014, 02:10 AM
  5. [SOLVED] VBA Code to copy all data from sheet 1 and paste it to sheet5 using a command button
    By Angnz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-10-2013, 10:06 PM
  6. Command button to add rows, copy and paste formulas, and format.
    By seankuus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2013, 08:37 PM
  7. How to create a command button to send specific cells out of an excel sheet..
    By meltelawi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-22-2013, 05:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1