![]() |
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 |
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 |
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 |
All times are GMT +1. The time now is 03:53 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com