passing spreadsheet cell data to macro
Thanks for the help but I am getting a (Runtime error 13 Type Mismatch) when
the macro gets to
sh.Columns(vCol).Hidden = True
What could be causing this?
Neal
"Bob Phillips" wrote in message
...
Neal,
vCol = Range("N42").Value & ":" & Range("N42").Value
For Each sh in ActiveWindow.SelectedSheets
sh.Columns(vCol).Hidden = True
Next
--
HTH
Bob Phillips
"Neal" wrote in message
...
I have a macro to hide a column in an array of worksheets. I would like
to have
it get the column from a cell in a worksheet. How do I go about doing
that? In
other words, If cell N42 has a J in it, then the J would be transferred to
the
macro.
Dim sh As Worksheet
For Each sh In ActiveWindow.SelectedSheets
sh.Columns("g:g").Hidden = True
Next
Thanks
Neal
|