PC Review


Reply
Thread Tools Rate Thread

checking if a column is hidden

 
 
=?Utf-8?B?Sm9obg==?=
Guest
Posts: n/a
 
      12th Jun 2007
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 With Quote
 
 
 
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      12th Jun 2007
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
>

 
Reply With Quote
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      12th Jun 2007
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
>

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      12th Jun 2007
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" <(E-Mail Removed)> wrote in message
news:3DDF84D0-E867-423E-AFD4-(E-Mail Removed)...
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checking to see if a user form is hidden Alteran Microsoft Excel Programming 5 27th Nov 2009 05:20 PM
2007 Worksheet, Hidden Columns, .CSV Format Saves Hidden Column Da Tammy Microsoft Excel Misc 3 2nd Apr 2009 11:40 PM
Checking if form is hidden =?Utf-8?B?U3R1Sm9s?= Microsoft Access Forms 2 14th Sep 2006 01:46 PM
checking for hidden columns =?Utf-8?B?c3RpY2thbmRyb2Nr?= Microsoft Excel Programming 5 21st Dec 2005 03:57 PM
showing hidden coulmns when checking the CHECK BOX =?Utf-8?B?QUc=?= Microsoft Excel Misc 2 14th Sep 2004 02:54 PM


Features
 

Advertising
 

Newsgroups
 


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