#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Open Event

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Open Event

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 Bruin
http://www.rondebruin.nl/tips.htm


"jlclyde" wrote in message ...
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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Open Event

On Sep 17, 10:31*am, "Ron de Bruin" wrote:
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



"jlclyde" wrote in ...
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- Hide quoted text -


- 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
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Open Event

Show use the macro



--

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


"jlclyde" wrote in message ...
On Sep 17, 10:31 am, "Ron de Bruin" wrote:
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



"jlclyde" wrote in ...
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- Hide quoted text -


- 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
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Open Event

Don't use Run

Simply..........

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

etc.


Gord Dibben MS Excel MVP

On Wed, 17 Sep 2008 08:19:22 -0700 (PDT), jlclyde
wrote:

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




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Open Event

Or use

Call macroname

--

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


"Gord Dibben" <gorddibbATshawDOTca wrote in message ...
Don't use Run

Simply..........

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

etc.


Gord Dibben MS Excel MVP

On Wed, 17 Sep 2008 08:19:22 -0700 (PDT), jlclyde
wrote:

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Workbook open event Pawan Excel Worksheet Functions 7 August 26th 08 07:32 AM
work book open _ event Hassan Excel Worksheet Functions 1 July 3rd 08 12:49 PM
App_change event to open all work book [email protected] Excel Discussion (Misc queries) 1 August 2nd 07 03:52 PM
Macro doesn't work when used as Workbook Open event Phil Excel Discussion (Misc queries) 2 October 20th 06 02:42 PM
Event: open workbook Jeff Excel Discussion (Misc queries) 1 September 28th 06 02:58 PM


All times are GMT +1. The time now is 01:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"