Retrieving value from range name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a one-cell range on “Sheet1†named “First_Column_to_Hideâ€. The value
of “First_Column_to_Hide†is always a column address. Is there a way I can
“retrieve†the value from “First_Column_to_Hide†to substitute for the “ZZZâ€
(placeholder) in the code segment below?

Sub HideUnhideColumns()
Application.ScreenUpdating = False
ActiveSheet.Columns("N:BE").EntireColumn.Hidden = False
ActiveSheet.Columns("ZZZ:BE").EntireColumn.Hidden = True
Application.ScreenUpdating = True
End Sub

I would appreciate any help on this. Thanks.
 
ActiveSheet.Columns(Range("First_Column_To_Hide").Value &
":BE").EntireColumn.Hidden = True


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top