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 Help with this error Unknown reason for error with Range().Select

Here is my code. The error happens when the sheet is changed and it selects
the starting cell for Movie1 sheet. The error says "Select Method of Range
Class failed". I have never ran into this problem before. If anyone has any
ideas on other ways to accomplish what I am trying to do I am open to any
suggestions

'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(9 To 22) As Integer
Dim Movie(9 To 22) As Integer
Dim X As Integer

Private Sub cmdApply_Click()
Worksheets("Main").Activate
Range("A3").Select
If ActiveCell.Value = "" Then GoTo E
Day = ActiveCell.Value

For X = 9 To 22
Range("C5").Select
Movie(X) = ActiveCell.Value
ActiveCell.Offset(0, 2).Select
Next X

For X = 9 To 22
Range("C3").Select
PCount(X) = ActiveCell.Value
ActiveCell.Offset(0, 2).Select
Next X

Worksheets("Movie1").Activate
Range("C3").Select
ActiveCell.Offset(Day, 0).Select
For X = 9 To 22
If X = Movie(X) Then
ActiveCell.Value = PCount(X)
Else
ActiveCell.Value = 0
End If
ActiveCell.Offset(0, 2).Select
Next X

Worksheets("Movie2").Activate
Range("C3").Select
ActiveCell.Offset(Day, 0).Select
For X = 9 To 22
If X = Movie(X) Then
ActiveCell.Value = PCount(X)
Else
ActiveCell.Value = 0
End If
ActiveCell.Offset(0, 2).Select
Next X

Worksheets("Movie3").Activate
Range("C3").Select
ActiveCell.Offset(Day, 0).Select
For X = 9 To 22
If X = Movie(X) Then
ActiveCell.Value = PCount(X)
Else
ActiveCell.Value = 0
End If
ActiveCell.Offset(0, 2).Select
Next X

Worksheets("Movie4").Activate
Range("C3").Select
ActiveCell.Offset(Day, 0).Select
For X = 9 To 22
If X = Movie(X) Then
ActiveCell.Value = PCount(X)
Else
ActiveCell.Value = 0
End If
ActiveCell.Offset(0, 2).Select
Next X

E: End Sub

 
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
#NAME? error for no apparent reason... Monomeeth Excel Worksheet Functions 4 September 15th 08 08:22 AM
Range Select Error sailingdan Excel Programming 1 June 14th 04 04:24 PM
Automation Error, Unknown Error. Error value - 440 Neo[_2_] Excel Programming 0 May 29th 04 05:26 AM
Run-time 1004 error on range select Morgan[_3_] Excel Programming 3 November 11th 03 11:44 PM
Unknown where is the problem on the Runtime error - Automation error wellie Excel Programming 1 July 10th 03 08:12 AM


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