VBA offset and resize

Isabella

Well-known Member
Joined
Nov 7, 2008
Messages
643
Hi in VBA how do i get the code to copy B and E

.Range("A5").CurrentRegion.Offset(, 1).???


Excel Workbook
ABCDE
520/03/2011Test112123.36James
620/03/2011Test212345.32James
720/03/2011Test312345.32James
820/03/2011Test412345.32James
920/03/2011Test512345.32James
1020/03/2011Test612345.32James
1120/03/2011Test712345.32James
1220/03/2011Test812345.32James
Sheet5
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
This might work, assumes you don't always know how many rows are in the range. Could depend on what you're doing once copied

Code:
Intersect(Range("A5").CurrentRegion, Range("B:B,E:E")).Copy
 
Upvote 0
I would go with Weaver's approach:

Code:
Set rngToCopy = Application.Intersect(.Range("A5").CurrentRegion,.Range("B:B,E:E"))
 
rngToCopy.Copy
 
'ect etc
 
Upvote 0

Forum statistics

Threads
1,224,524
Messages
6,179,304
Members
452,904
Latest member
CodeMasterX

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