Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the code below and I keep getting this error meesage, "Select
Method of Range Class failed". I am trying to just side some column when a user clicks a button. Private Sub FirstChooser_Click() Application.ScreenUpdating = False Sheets("Model").Select Columns("P:Q").Select Selection.EntireColumn.Hidden = True Columns("S:T").Select Selection.EntireColumn.Hidden = True Range("O56").Select Application.ScreenUpdating = True End Sub Thanks for the help. Scott |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try following (not tested)
Private Sub FirstChooser_Click() Application.ScreenUpdating = False With Worksheets("Model") .Activate .Columns("P:Q").EntireColumn.Hidden = True .Columns("S:T").EntireColumn.Hidden = True .Range("O56").Select End With Application.ScreenUpdating = True End Sub -- JB "Scott Halper" wrote: I have the code below and I keep getting this error meesage, "Select Method of Range Class failed". I am trying to just side some column when a user clicks a button. Private Sub FirstChooser_Click() Application.ScreenUpdating = False Sheets("Model").Select Columns("P:Q").Select Selection.EntireColumn.Hidden = True Columns("S:T").Select Selection.EntireColumn.Hidden = True Range("O56").Select Application.ScreenUpdating = True End Sub Thanks for the help. Scott |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Your code works fine for me. Are you in the workbook containing sheets
"model"? Do you have a chart selected by any chance? Which line is failing? What version of Excel are you using? There was a problem quite a while ago with the button taking the focus. Try adding the line "selection.activate" as the first line. Bob Flanagan Macro Systems http://www.add-ins.com Productivity add-ins and downloadable books on VB macros for Excel "Scott Halper" wrote in message ... I have the code below and I keep getting this error meesage, "Select Method of Range Class failed". I am trying to just side some column when a user clicks a button. Private Sub FirstChooser_Click() Application.ScreenUpdating = False Sheets("Model").Select Columns("P:Q").Select Selection.EntireColumn.Hidden = True Columns("S:T").Select Selection.EntireColumn.Hidden = True Range("O56").Select Application.ScreenUpdating = True End Sub Thanks for the help. Scott |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. | Excel Programming | |||
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... | Excel Programming | |||
Modification in the CODE to HIDE rows and columns that start with ZERO (code given) | Excel Programming | |||
Excel code convert to Access code - Concat & eliminate duplicates | Excel Programming |