Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Color a range

Status
Not open for further replies.

khansen97

Programmer
Oct 14, 2003
60
US
I am trying to color a range. I cannot figure out the code to define my range.

I want it to be

Row = rnum
column A to W (or 1 to 23)

I know the syntax is activeworksheet.range("RANGE")..Interior.Color = RGB(211, 211, 211)


But I don't know how to put my range in the "RANGE" variable.

Can anybody help?
 
Hi,
Code:
Row = rnum
column A to W (or 1 to 23)

with activeworksheet
  .range(.Cells(rnum, "A"), .Cells(rnum, "W")).Interior.Color = RGB(211, 211, 211)
end with
:)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Something like this ?
ActiveWorksheet.Range("A" & rnum & ":W" & rnum).Interior.Color = RGB(211, 211, 211)


Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top