Open Event

  • Thread starter Thread starter jlclyde
  • Start date Start date
J

jlclyde

Can you have an open event select a cell? I am trying to run macros
and select cells and it is nto working. Here is my code. As soon as
it gets to a line to select a cell it errors out.
Thanks,
Jay

Private Sub Workbook_Open()
Application.ScreenUpdating = False
Run "SortSheets1"
Run "SortSheets2"
Sheets("HK Ips").Range("E5").Select
Run "AddSheet"
Sheet2.Range("C5").Select
Run "AddSheet"
Sheet3.Range("C5").Select
Run "AddSheet"
Sheet4.Range("E5").Select
Run "AddSheet"
Sheet5.Range("E5").Select
Run "AddSheet"
Sheet6.Range("E5").Select
Sheet7.Range("C5").Select
Run "AddSheet"
Sheet8.Range("E5").Select
Run "AddSheet"
Sheet9.Range("E5").Select
Run "AddSheet"
Sheet11.Range("D5").Select
Run "AddSheet"
Sheet12.Range("E5").Select
Run "AddSheet"
Run "SortSheets1"
Application.ScreenUpdating = True
End Sub
 
You not need to select cells with code for 99%
Change you code without selecting

You can't select a cell on a sheet that is not active so first select the sheet and then the cell
 
You not need to select cells with code for 99%
Change you code without selecting

You can't select a cell on a sheet that is not active so first select thesheet and then the cell

--

Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm






- Show quoted text -

OK. I have to select cells in this case because the macro that runs
is a do until selection, so I have am telling it where to start. Now
one of the Macros comes up as an error "the Macro AddSheet can not be
found" I know it is in Module1 so I do nto knwo what to do about
this. Let me knwo if I shoudl start a new post since the subject
changed.
Thanks,
Jay
 
Show use the macro



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


You not need to select cells with code for 99%
Change you code without selecting

You can't select a cell on a sheet that is not active so first select the sheet and then the cell

--

Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm






- Show quoted text -

OK. I have to select cells in this case because the macro that runs
is a do until selection, so I have am telling it where to start. Now
one of the Macros comes up as an error "the Macro AddSheet can not be
found" I know it is in Module1 so I do nto knwo what to do about
this. Let me knwo if I shoudl start a new post since the subject
changed.
Thanks,
Jay
 
Don't use Run

Simply..........

Private Sub Workbook_Open()
Application.ScreenUpdating = False
SortSheets1
SortSheets2

etc.


Gord Dibben MS Excel MVP
 
Back
Top