Range - select row

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In my macro I have a range set to a single cell. The cell the range refers
to changes throughout my program. I want to bold the entire row (or at least
the first X columns in that row) that the range is on.

Thanks,
Scott Hanebutt
 
dim myCell as range

set mycell = worksheets("sheet99").range("x99") 'or something

mycell.entirerow.font.bold = true

or
mycell.entirerow.resize(1, 10).font.bold = true

Change 10 to whatever X meant.
 
This is just an example. Select a single cell and run this macro:

Sub Macro3()
Dim r As Range
Dim s As String
Set r = Selection
s = r.Row
Rows(s).Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
End Sub

Of course, you would set r to whatever your range is, not Selection.
 
Thanks to everyone who replied. I decided to use Dave's suggestion and it
worked perfectly.

Thanks,
Scott Hanebutt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top