View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_5_] Bob Phillips[_5_] is offline
external usenet poster
 
Posts: 620
Default passing spreadsheet cell data to macro


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