LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Can a variable be used in a Worksheet().Activate method

I am needing to place data into different worksheets depending on choices
from the user. I am needing to activate the worksheets based on those
choices. I was using the folowing code but am running into problems, and am
not sure how to get it to work.

'Day is row to place info in
'Movie is the name of the movie for that time
'PCount is the Performance Count for that time
Dim Day As Integer
Dim PCount As Integer
Dim Movie As Integer

Private Sub cmdApply_Click()
Range("A3").Select
Day = ActiveCell.Value + 3
'9am
Range("C5").Select
Movie = ActiveCell.Value
Range("C3").Select
PCount = ActiveCell.Value
Worksheets(Movie).Active
Range("C" & Day).Select
ActiveCell.Value = PCount

the movie variable has been done as a integer with the sheet index and as a
string with the sheet name both having problems. Any help is appreciated.
 
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
Activate method of Worksheet class fails in Excel 2000 Chris Bloom Excel Discussion (Misc queries) 3 September 10th 05 12:05 AM
Activate method of OLEObject failed jose luis Excel Programming 0 June 3rd 05 04:55 AM
Reference to a variable in windows(???).Activate John Baker Excel Programming 7 July 13th 04 02:04 PM
How to activate a file when the filename is represented by a string variable news.sintef.no Excel Programming 4 February 6th 04 02:17 PM
why error for activate method Young-Hwan Choi Excel Programming 2 December 10th 03 08:31 AM


All times are GMT +1. The time now is 08:12 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"