View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett[_2_] Don Guillett[_2_] is offline
external usenet poster
 
Posts: 1,522
Default How to change this macro

Sub trythisidea() 'a little different

lr = Cells(Rows.Count, "b").End(xlUp).Row
For i = 2 To 8 Step 2
With Cells(2, i).Resize(lr - 1).Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Cells(3, i).Clear
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"KennyD" wrote in message
...
Need help changing the range on this range so that it will go to the last
row. For example, instead of going from B2,B4:B18, I need it to go from
B2,B4:"the last row that has any information in it". Same with column D,
Column F and Column H. So I imagine something like B2,B4:B&LastRow. But
don't know how to make that happen. Any help would be greatly
appreciated.

Range("B2,B4:B18,D2,D4:D18,F2,F4:F18,H2,H4:H18").S elect
Range("H4").Activate
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
.PatternTintAndShade = 0
End With
--
Nothing in life is ever easy - just get used to that fact.