VBA Help

Jennifer Van

New Member
Joined
Apr 22, 2022
Messages
41
Office Version
  1. 2016
Platform
  1. Windows
Range(Cells(Target.Row, "A"), Cells(Target.Row, "C")).Copy Sheets("WaitList").Range("A" & Rows.Count).End(3)(2)
End If
Hi
This works well and copies the first 3 cells onto another worksheet. Can someone show me how I now add three more columns to copy - I now want, as well as columns ABC, I also want MNO - I have tried playing with the above forumula with no luck!
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
You can try using "Union" and "Resize".
VBA Code:
Union(Cells(Target.Row, "A").Resize(, 3), Cells(Target.Row, "M").Resize(, 3)).Copy _
  Sheets("WaitList").Range("A" & Rows.Count).End(3)(2)
 
Upvote 0
Solution
Another option, if you want to copy on the target row and same columns as first sheet.
Put resized ranges addresses in the array and copy them one by one from there.
VBA Code:
    vAreas = Array(Range("A" & Target.Row).Resize(, 3), _
                   Range("M" & Target.Row).Resize(, 3))
    For Each vArea In vAreas
        ActiveSheet.Range(vArea.Address).Copy _
        Sheets("WaitList").Range(vArea.Address)
    Next
 
Upvote 0
VBA Code:
With Sheets("WaitList")
    Dim r&: r = .Cells(Rows.Count, "A").End(3)(2).Row
    Cells(Target.Row, "A").Resize(, 3).Copy .Cells(r, "A")
    Cells(Target.Row, "M").Resize(, 3).Copy .Cells(r, "M")
End With
 
Upvote 0
You can try using "Union" and "Resize".
VBA Code:
Union(Cells(Target.Row, "A").Resize(, 3), Cells(Target.Row, "M").Resize(, 3)).Copy _
  Sheets("WaitList").Range("A" & Rows.Count).End(3)(2)
Thank you so much this worked
 
Upvote 0
I'm glad you found this as solution, but with all options,
including FooToo's code, you can do more tricks.
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top