VBA Coding between the lines!

Peggy2015

Board Regular
Joined
Oct 19, 2015
Messages
109
Hello,

How do I write a code to highlight everything, including the blank lines? I need to highlight and copy everything in B1:E7, and I seem to be stuck at just highlighting B1:E2. ActiveCell.CurrentRegion.Select isn't giving me much joy. I'm stuck in a virtual loop!

Thanks for your help.

Best wishes,
Peggy

[TABLE="class: cms_table_grid, width: 500, align: left"]
<tbody>[TR]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Cash
[/TD]
[TD]Stationery
[/TD]
[TD][/TD]
[TD]{formula = }Cash - Stationery
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Cash
[/TD]
[TD]Cards
[/TD]
[TD][/TD]
[TD]{formula = }Cash - Cards
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]Cheque
[/TD]
[TD]Rooms
[/TD]
[TD][/TD]
[TD]{formula = }Cheque - Rooms
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]EFT
[/TD]
[TD]Stationery
[/TD]
[TD][/TD]
[TD]{formula = }EFT - Stationery
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]EFT
[/TD]
[TD]Cards
[/TD]
[TD][/TD]
[TD]{formula = }EFT - Cards
[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
How about
Code:
Range("B1", Range("B" & Rows.Count).End(xlUp).Offset(, 3)).Copy
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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