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.
|