shippey121
Well-known Member
- Joined
- Mar 21, 2006
- Messages
- 1,003
hi all
started a new role and using excel more and more, no expert in VBA a novice at best but trying to learn. currently stuck on a way to accomplish this so thought id ask.
i want to select and area and format only part of the selection. the code below will format the entire selection, if i selected say A1 to F10 and wanted to colour only the 5th column of the selection, so in this case, E1:E10 green,
i tried this but it still format the entire selection
doing this
formats the 5th column but only on the first row
any help would be appreciated
started a new role and using excel more and more, no expert in VBA a novice at best but trying to learn. currently stuck on a way to accomplish this so thought id ask.
i want to select and area and format only part of the selection. the code below will format the entire selection, if i selected say A1 to F10 and wanted to colour only the 5th column of the selection, so in this case, E1:E10 green,
Code:
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
End With
i tried this but it still format the entire selection
Code:
With Selection.Cells(, 5)
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
End With
End With
doing this
Code:
With Selection.Cells(, 5).Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
End With
formats the 5th column but only on the first row
any help would be appreciated
Last edited: