Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Workbook Open but not visible (and not HIDDEN?!?) | Excel Discussion (Misc queries) | |||
If a certain cell has a certain value, a certain worksheet is hidden or visible | Excel Programming | |||
differentiate between a visible and a hidden userform | Excel Programming | |||
Making sheets visible / hidden | Excel Programming | |||
Check status row (hidden or visible)? | Excel Programming |