Code not working within hidden column range

R

RobN

Using vs 2007, how can this be modified so that it will colour hidden
columns within the range?

If Target = "F" Then
With Target.Offset(0, -ColNumber + 1).Resize(1, ColNumber + 15).Interior
.ColorIndex = 5
.Pattern = xlSolid
End With
End If

Rob
 
J

Jarek Kujawa

Would this help?


If Target = "F" Then
With Target.Offset(0, -ColNumber + 1).Resize(1, ColNumber +
15).Select
For Each cell In Selection
If cell.Columns.Hidden Then
cell.Columns.EntireColumn.Interior.ColorIndex = 5
End If
Next cell
End With
End If
 

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

Top