ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hidden Column (https://www.excelbanter.com/excel-programming/329351-hidden-column.html)

Ashman

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


JE McGimpsey

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


Ashman

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



JE McGimpsey

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.


Ashman

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.




All times are GMT +1. The time now is 02:57 AM.

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