Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detect Hidden Columns
How can I detect if any columns have been hidden on a worksheet in vba?
I would like to use this to prevent a modal form (called from wsheet1) initialising and also in a Workbook_BeforeClose event which contains 4 wsheets. Geoff |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detect Hidden Columns
Sub geoff()
For i = 1 To 256 If Columns(i).EntireColumn.Hidden = True Then MsgBox ("column " & i & " is hidden") End If Next End Sub -- Gary''s Student gsnu200711 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detect Hidden Columns
Thank you, I can adapt from that.
Geoff "Gary''s Student" wrote: Sub geoff() For i = 1 To 256 If Columns(i).EntireColumn.Hidden = True Then MsgBox ("column " & i & " is hidden") End If Next End Sub -- Gary''s Student gsnu200711 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detect Hidden Columns
Given that people are using v2007 now, it would be better not to hard code
the row count: Private Sub CommandButton1_Click() Dim i As Long With ActiveSheet.Columns For i = 1 To .Count If .Item(i).EntireColumn.Hidden = True Then MsgBox "column " & i & " is hidden" End If Next End With End Sub NickHK "Gary''s Student" wrote in message ... Sub geoff() For i = 1 To 256 If Columns(i).EntireColumn.Hidden = True Then MsgBox ("column " & i & " is hidden") End If Next End Sub -- Gary''s Student gsnu200711 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detect Hidden Columns
good point.
b.t.w - what's an item ? -- Gary''s Student gsnu200711 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detect Hidden Columns
Collections have a member of .Item.
..Columns(i) is equivalent to .Columns.Item(i) Only so I could include both in the With block. NickHK "Gary''s Student" wrote in message ... good point. b.t.w - what's an item ? -- Gary''s Student gsnu200711 |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detect Hidden Columns
thanks
-- Gary''s Student |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Detect Hidden Columns by Formula | Excel Programming | |||
Detect Hidden Rows by Formula | Excel Programming | |||
How do I detect hidden worksheets or hidden data on a worksheet? | Excel Discussion (Misc queries) | |||
How to detect if a workbook is hidden through VBA | Excel Programming | |||
How to detect if sheet is hidden? | Excel Worksheet Functions |