Highlight Row with a specific range

adtc

New Member
Joined
Aug 2, 2011
Messages
11
Hi team,

Have been working on a HUGE project and, thanks to all the help from this forum, it's nearly done!
Just trying to get some of the aesthetics in order now.

I have the following line of code:

cell2.EntireRow.Interior.ColorIndex = 3

It highlights (in red) the .EntireRow of the targeted cell (cell2). But this means it goes ALL the way to the right to cell XXXXY or something to that effect.

I was hoping it could be altered to highlight only A:N on that row.

Thank you for any help/ideas, much appreciate.
And thanks again to everyone that has helped me get to this point!

ADTC.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Range(Cells(cell2.Row, 1), Cells(cell2.Row, 14)).Interior.ColorIndex = 3

14 Represents column "N" You change it accordingly.
 
Upvote 0
Yet another option
Code:
cell2.EntireRow.Resize(, 14).Interior.ColorIndex = 3
 
Upvote 0
Perfect.

Thank you very much for the prompt responses prajul89 and VoG.

Project complete :)
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,844
Members
452,948
Latest member
UsmanAli786

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