Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Sheet_activate event (to another Sheet and back again.....)

I want some code to run whenever Sheet8 is activated, so am running the code
(which is "stored" in ThisWorkbook) on the sheet.activate event.

The code essentially is a counter function, going to Sheet3, getting values
for 3 counters, and then going back to Sheet8 to enter the value for the
counters. I get an run-time error '1004" at this place in the code:

ActiveWorkbook.Worksheets(8).Select
Range("B" & (47 + Y)).Select
ActiveCell.Value = counterH

I surmise I'm mis-identifying Sheet8, but this is exactly how I identified
Sheet3, when I went there. I cannot get the code to continue. Any
suggestions, guys?

TIA


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default Sheet_activate event (to another Sheet and back again.....)

If the name of your worksheet is Sheet8, I would use
ActiveWorkbook.Worksheets("Sheet8").Select

Ed

"zSplash" <zNOSPAMSplash@ gci.net wrote in message
...
I want some code to run whenever Sheet8 is activated, so am running the

code
(which is "stored" in ThisWorkbook) on the sheet.activate event.

The code essentially is a counter function, going to Sheet3, getting

values
for 3 counters, and then going back to Sheet8 to enter the value for the
counters. I get an run-time error '1004" at this place in the code:

ActiveWorkbook.Worksheets(8).Select
Range("B" & (47 + Y)).Select
ActiveCell.Value = counterH

I surmise I'm mis-identifying Sheet8, but this is exactly how I identified
Sheet3, when I went there. I cannot get the code to continue. Any
suggestions, guys?

TIA




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Sheet_activate event (to another Sheet and back again.....)

Thank you, Ed. For some reason, that worked. Appreciate it.

st.

"Ed" wrote in message
...
If the name of your worksheet is Sheet8, I would use
ActiveWorkbook.Worksheets("Sheet8").Select

Ed

"zSplash" <zNOSPAMSplash@ gci.net wrote in message
...
I want some code to run whenever Sheet8 is activated, so am running the

code
(which is "stored" in ThisWorkbook) on the sheet.activate event.

The code essentially is a counter function, going to Sheet3, getting

values
for 3 counters, and then going back to Sheet8 to enter the value for the
counters. I get an run-time error '1004" at this place in the code:

ActiveWorkbook.Worksheets(8).Select
Range("B" & (47 + Y)).Select
ActiveCell.Value = counterH

I surmise I'm mis-identifying Sheet8, but this is exactly how I

identified
Sheet3, when I went there. I cannot get the code to continue. Any
suggestions, guys?

TIA






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
Worksheet Change Event - copy cell to another sheet dhstein Excel Discussion (Misc queries) 2 October 12th 09 06:35 PM
Cancel sheet change event NSK Charts and Charting in Excel 1 July 17th 07 08:25 PM
workbook/sheet event macro TUNGANA KURMA RAJU Excel Discussion (Misc queries) 4 December 27th 05 12:00 PM
Sheet Name Change Event? Bob L. Excel Programming 0 August 18th 03 10:08 PM
Sheet Name Change Event? Bob Phillips[_5_] Excel Programming 0 August 18th 03 09:57 PM


All times are GMT +1. The time now is 12:11 PM.

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

About Us

"It's about Microsoft Excel"