Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Check if a column is hidden or visible in VBA

I have some VBA code which copies part of a spreadsheet to a new workbook,
when i copy it i need to be able to check if a column has been hidden or not,
if it has been hidden then i need to hide the same column on the new sheet.

e.g. If column F is hidden on the current sheet then hide column F on the
new workbook.

I am using Excel 2000.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default Check if a column is hidden or visible in VBA

Can you please post up the code as it currently is?

Stephen C wrote:
I have some VBA code which copies part of a spreadsheet to a new workbook,
when i copy it i need to be able to check if a column has been hidden or not,
if it has been hidden then i need to hide the same column on the new sheet.

e.g. If column F is hidden on the current sheet then hide column F on the
new workbook.

I am using Excel 2000.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Check if a column is hidden or visible in VBA

Just tweak this until it fits your specific needs:

Sub HiddenColumns()
Dim i As Long

For i = 1 To 256
Workbooks("Workbook1").Sheets("Sheet1").Columns(i) .Hidden =
Workbooks("Workbook1").Sheets("Sheet1").Columns(i) .Hidden
Next i

End Sub

------
Cheers,
Anony


"Stephen C" wrote:

I have some VBA code which copies part of a spreadsheet to a new workbook,
when i copy it i need to be able to check if a column has been hidden or not,
if it has been hidden then i need to hide the same column on the new sheet.

e.g. If column F is hidden on the current sheet then hide column F on the
new workbook.

I am using Excel 2000.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Check if a column is hidden or visible in VBA

Just a little tweak and it works fine.

Thank you

"Anony" wrote:

Just tweak this until it fits your specific needs:

Sub HiddenColumns()
Dim i As Long

For i = 1 To 256
Workbooks("Workbook1").Sheets("Sheet1").Columns(i) .Hidden =
Workbooks("Workbook1").Sheets("Sheet1").Columns(i) .Hidden
Next i

End Sub

------
Cheers,
Anony


"Stephen C" wrote:

I have some VBA code which copies part of a spreadsheet to a new workbook,
when i copy it i need to be able to check if a column has been hidden or not,
if it has been hidden then i need to hide the same column on the new sheet.

e.g. If column F is hidden on the current sheet then hide column F on the
new workbook.

I am using Excel 2000.

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
Workbook Open but not visible (and not HIDDEN?!?) mcleester Excel Discussion (Misc queries) 0 December 30th 08 03:02 PM
If a certain cell has a certain value, a certain worksheet is hidden or visible Matt[_40_] Excel Programming 3 February 9th 07 06:49 AM
differentiate between a visible and a hidden userform RB Smissaert Excel Programming 2 June 30th 05 10:11 PM
Making sheets visible / hidden Xlyr Excel Programming 1 March 6th 05 07:45 PM
Check status row (hidden or visible)? Martin Los Excel Programming 1 December 18th 03 03:32 PM


All times are GMT +1. The time now is 01:40 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"