Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am receiving an error: "Run Time Error 1004 Select
method of worksheet class failed" on the following section of code: Sheets("Forecasts").Select Cells.Select Selection.Sort Key1:=Range("Q2"), Order1:=xlAscending, _ Header:=xlGuess, OrderCustom:=1, MatchCase:= _ False, Orientation:=xlTopToBottom Sheets("UpdatePeriod").Select <---- ERROR ON THIS LINE Period = Range("a6").Value This macro seemed to work fine until I added a form to the spreadsheet. Is the form causing issues related to the class I'm using? TIA. Dana |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Its more likely that you renamed the sheet "UpdatePeriod" or are now
spelling it with a space or that sheet doesn't exist. Robert Flanagan Macro Systems Delaware, U.S. 302-234-9857 http://www.add-ins.com Productivity add-ins and downloadable books on VB macros for Excel "Dana Sherbondy" wrote in message ... I am receiving an error: "Run Time Error 1004 Select method of worksheet class failed" on the following section of code: Sheets("Forecasts").Select Cells.Select Selection.Sort Key1:=Range("Q2"), Order1:=xlAscending, _ Header:=xlGuess, OrderCustom:=1, MatchCase:= _ False, Orientation:=xlTopToBottom Sheets("UpdatePeriod").Select <---- ERROR ON THIS LINE Period = Range("a6").Value This macro seemed to work fine until I added a form to the spreadsheet. Is the form causing issues related to the class I'm using? TIA. Dana |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It was marked as hidden. I 'unhide' it and it worked.
Thank you so much! Dana -----Original Message----- Its more likely that you renamed the sheet "UpdatePeriod" or are now spelling it with a space or that sheet doesn't exist. Robert Flanagan Macro Systems Delaware, U.S. 302-234-9857 http://www.add-ins.com Productivity add-ins and downloadable books on VB macros for Excel "Dana Sherbondy" wrote in message ... I am receiving an error: "Run Time Error 1004 Select method of worksheet class failed" on the following section of code: Sheets("Forecasts").Select Cells.Select Selection.Sort Key1:=Range("Q2"), Order1:=xlAscending, _ Header:=xlGuess, OrderCustom:=1, MatchCase:= _ False, Orientation:=xlTopToBottom Sheets("UpdatePeriod").Select <---- ERROR ON THIS LINE Period = Range("a6").Value This macro seemed to work fine until I added a form to the spreadsheet. Is the form causing issues related to the class I'm using? TIA. Dana . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run-Time error '1004' : Select method of Range class failed | Excel Discussion (Misc queries) | |||
RUNTIME ERROR '1004' --- Select method of worksheet class failed | Excel Programming | |||
excel97: runtime error 1004 select method of range class failed | Excel Programming | |||
error 1004 Select method of Range class failed | Excel Programming |