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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
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,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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