Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default checking if a column is hidden

How would i write this in VBA please. I would like to check if a selection
of columns is hidden, then take an action depending on the circumstance.

Thanks

John

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default checking if a column is hidden

One way:-

Sub imhidden()
Columns("b:b").Select
If Selection.EntireColumn.Hidden = True Then
MsgBox ("Can't see me")
Else
MsgBox ("I'm visible")
End If
End Sub

Mike

"John" wrote:

How would i write this in VBA please. I would like to check if a selection
of columns is hidden, then take an action depending on the circumstance.

Thanks

John

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default checking if a column is hidden

a bit neater

Sub imhidden()
If Columns("b:b").Hidden = True Then
MsgBox ("Can't see me")
Else
MsgBox ("I'm visible")
End If
End Sub

Mike

"John" wrote:

How would i write this in VBA please. I would like to check if a selection
of columns is hidden, then take an action depending on the circumstance.

Thanks

John

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default checking if a column is hidden

Public Sub Test()
Dim cHidden As Long
Dim col As Range

cHidden = 0
For Each col In Columns("E:H").Columns
If col.Hidden Then
cHidden = cHidden + 1
End If
Next col
MsgBox cHidden & " columns are hidden"
End Sub


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"John" wrote in message
...
How would i write this in VBA please. I would like to check if a
selection
of columns is hidden, then take an action depending on the circumstance.

Thanks

John



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
2007 Worksheet, Hidden Columns, .CSV Format Saves Hidden Column Da Tammy Excel Discussion (Misc queries) 3 April 2nd 09 11:40 PM
Checking Column Entries gtb Excel Worksheet Functions 9 November 3rd 08 06:10 AM
Checking a cell's (Row,Column) Craig[_21_] Excel Programming 3 December 25th 05 01:47 PM
checking for hidden columns stickandrock Excel Programming 5 December 21st 05 03:57 PM
checking value in column sals Excel Programming 1 December 18th 03 08:01 PM


All times are GMT +1. The time now is 03:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"