ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Code not working within hidden column range (https://www.excelbanter.com/excel-discussion-misc-queries/181060-code-not-working-within-hidden-column-range.html)

RobN[_2_]

Code not working within hidden column range
 
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



Jarek Kujawa[_2_]

Code not working within hidden column range
 
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



All times are GMT +1. The time now is 07:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com