How to Highlight an Additional Column without Referencing Specific Cells

CJBills

New Member
Joined
Apr 27, 2015
Messages
13
I'm attempting to highlight an array plus an additional, empty (or partially empty) column to the right of the highlighted array.

I'm using "Range(Selection, Selection.End(xlToRight)).Select" to highlight the data.
[TABLE="width: 300"]
<TBODY>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Data
[/TD]
[TD]Data
[/TD]
[TD]No Data
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Data
[/TD]
[TD]Data
[/TD]
[TD]No Data
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]No Data
[/TD]
[TD]No Data
[/TD]
[TD]No Data
[/TD]
[/TR]
</TBODY>[/TABLE]

The code must not include specified cells; each month the number of rows may change. Currently, the macro recorder auto-inputs the above code, then "Range(C1:C2).Select" in the following line.

Any suggestions?

I have tried "Range(Selection, Selection.End(xlToRight)).Offset(0, 1).Select". This seems to shift the entire highlighted array range, causing an omission of the first column, which needs to be included in the highlight.
[TABLE="width: 300"]
<TBODY>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Data
[/TD]
[TD]Data
[/TD]
[TD]No Data
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Data
[/TD]
[TD]Data
[/TD]
[TD]No Data
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]No Data
[/TD]
[TD]No Data
[/TD]
[TD]No Data
[/TD]
[/TR]
</TBODY>[/TABLE]

Thank you in advance.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Try:
Code:
Range(Selection, Selection.End(xlToRight)).Resize(1, Range(Selection, _
        Selection.End(xlToRight)).Columns.Count + 1).Select
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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