Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Hidden Column

G'Day all,

I have a quick question. In a worksheet I have a column which sometimes is
hidden.

How do I use a macro to detect if the column is hidden or not?

Any help would be much appreciated.

Thanks

Jas

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Hidden Column

One way:

Public Sub IsItHidden()
MsgBox IIf(Columns(3).Hidden, "", "Not ") & "Hidden"
End Sub

Change column number to suit.


In article ,
Ashman wrote:

G'Day all,

I have a quick question. In a worksheet I have a column which sometimes is
hidden.

How do I use a macro to detect if the column is hidden or not?

Any help would be much appreciated.

Thanks

Jas

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Hidden Column

Thanks for the help, but it did not work.

What I am trying to do if run an if statement, ie if the column is hidden
then run a procedure, if it is false, then run a different procedure.

The start of the if statement i would like to use, is:

sheets("money in").column(lastbank+2)

Can you help with this?

Jason

"JE McGimpsey" wrote:

One way:

Public Sub IsItHidden()
MsgBox IIf(Columns(3).Hidden, "", "Not ") & "Hidden"
End Sub

Change column number to suit.


In article ,
Ashman wrote:

G'Day all,

I have a quick question. In a worksheet I have a column which sometimes is
hidden.

How do I use a macro to detect if the column is hidden or not?

Any help would be much appreciated.

Thanks

Jas


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Hidden Column

What "didn't work"?

OTOH, it helps to explain what you're trying to do. Try something like:

If Sheets("money in").Columns(lastbank + 2).Hidden Then
Proc1
Else
Proc2
End If

Note that you need to use the ColumnS collection, not the Column
property.



In article ,
Ashman wrote:

Thanks for the help, but it did not work.

What I am trying to do if run an if statement, ie if the column is hidden
then run a procedure, if it is false, then run a different procedure.

The start of the if statement i would like to use, is:

sheets("money in").column(lastbank+2)

Can you help with this?

Jason

"JE McGimpsey" wrote:

One way:

Public Sub IsItHidden()
MsgBox IIf(Columns(3).Hidden, "", "Not ") & "Hidden"
End Sub

Change column number to suit.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Hidden Column

Many thanks, it worked perfectly.

Jas

"JE McGimpsey" wrote:

What "didn't work"?

OTOH, it helps to explain what you're trying to do. Try something like:

If Sheets("money in").Columns(lastbank + 2).Hidden Then
Proc1
Else
Proc2
End If

Note that you need to use the ColumnS collection, not the Column
property.



In article ,
Ashman wrote:

Thanks for the help, but it did not work.

What I am trying to do if run an if statement, ie if the column is hidden
then run a procedure, if it is false, then run a different procedure.

The start of the if statement i would like to use, is:

sheets("money in").column(lastbank+2)

Can you help with this?

Jason

"JE McGimpsey" wrote:

One way:

Public Sub IsItHidden()
MsgBox IIf(Columns(3).Hidden, "", "Not ") & "Hidden"
End Sub

Change column number to suit.


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
getting rid of a hidden column behind the front column mamie1159 Excel Discussion (Misc queries) 1 February 3rd 10 03:10 AM
2007 Worksheet, Hidden Columns, .CSV Format Saves Hidden Column Da Tammy Excel Discussion (Misc queries) 3 April 2nd 09 11:40 PM
Hidden column Joe Excel Discussion (Misc queries) 7 August 11th 07 08:33 PM
Getting column width of a hidden column? Don Wiss Excel Programming 1 May 3rd 05 12:36 AM
Hidden Column in VBA norika Excel Programming 4 February 4th 04 06:22 AM


All times are GMT +1. The time now is 12:43 PM.

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"