ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Subscript out of range (https://www.excelbanter.com/excel-programming/294744-subscript-out-range.html)

Stacy Haskins[_2_]

Subscript out of range
 
Why am I getting a "subscript out of range" error in the
following code?

Sub CheckSplits()
Sheets("Attendance").Select
If Range("X1") = "T" Then
SplitsOff
AttendanceSplitsOnOff = True
End If
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Sheets("StudentInfo").Select <=****HERE****
If Range("X1") = "T" Then
SplitsOff
StudentInfoSplitsOnOff = True
End If
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
End Sub

Vasant Nanavati

Subscript out of range
 
Most likely because you don't have a visible sheet named "StudentInfo" in
the active workbook. Check for typos, leading/trailing spaces, etc. to make
sure that the spelling in the code is identical to the spelling on the tab.

--

Vasant

"Stacy Haskins" wrote in message
...
Why am I getting a "subscript out of range" error in the
following code?

Sub CheckSplits()
Sheets("Attendance").Select
If Range("X1") = "T" Then
SplitsOff
AttendanceSplitsOnOff = True
End If
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Sheets("StudentInfo").Select <=****HERE****
If Range("X1") = "T" Then
SplitsOff
StudentInfoSplitsOnOff = True
End If
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
End Sub




Stacy Haskins[_2_]

Subscript out of range
 
That doesn't seem to be the case. I have copied the line
from different procedures, and it works everywhere else.
Any other suggestions?

-----Original Message-----
Most likely because you don't have a visible sheet

named "StudentInfo" in
the active workbook. Check for typos, leading/trailing

spaces, etc. to make
sure that the spelling in the code is identical to the

spelling on the tab.

--

Vasant

"Stacy Haskins" wrote in message
...
Why am I getting a "subscript out of range" error in

the
following code?

Sub CheckSplits()
Sheets("Attendance").Select
If Range("X1") = "T" Then
SplitsOff
AttendanceSplitsOnOff = True
End If
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Sheets("StudentInfo").Select <=****HERE****
If Range("X1") = "T" Then
SplitsOff
StudentInfoSplitsOnOff = True
End If
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
End Sub



.


Vasant Nanavati

Subscript out of range
 
Well, I can't think of another reason. You might want to double check the
following:

1. Is the sheet visible (i.e., not hidden)?

2. Is the sheet in the active workbook?

3. Is your code in a standard module (i.e., not in a sheet or workbook
module)?

4. Have you double- and triple-checked the spelling for slight variations
that may not be immediately apparent?

Other than that, I'm out of ideas.

--

Vasant


"Stacy Haskins" wrote in message
...
That doesn't seem to be the case. I have copied the line
from different procedures, and it works everywhere else.
Any other suggestions?

-----Original Message-----
Most likely because you don't have a visible sheet

named "StudentInfo" in
the active workbook. Check for typos, leading/trailing

spaces, etc. to make
sure that the spelling in the code is identical to the

spelling on the tab.

--

Vasant

"Stacy Haskins" wrote in message
...
Why am I getting a "subscript out of range" error in

the
following code?

Sub CheckSplits()
Sheets("Attendance").Select
If Range("X1") = "T" Then
SplitsOff
AttendanceSplitsOnOff = True
End If
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Sheets("StudentInfo").Select <=****HERE****
If Range("X1") = "T" Then
SplitsOff
StudentInfoSplitsOnOff = True
End If
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
End Sub



.




Leo Heuser[_3_]

Subscript out of range
 
Stacy

You may have collected some "dirt" during
copying the line. Try deleting all empty space
to the left of the line or delete the whole line
and manually enter it again.

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Stacy Haskins" skrev i en meddelelse
...
That doesn't seem to be the case. I have copied the line
from different procedures, and it works everywhere else.
Any other suggestions?

-----Original Message-----
Most likely because you don't have a visible sheet

named "StudentInfo" in
the active workbook. Check for typos, leading/trailing

spaces, etc. to make
sure that the spelling in the code is identical to the

spelling on the tab.

--

Vasant

"Stacy Haskins" wrote in message
...
Why am I getting a "subscript out of range" error in

the
following code?

Sub CheckSplits()
Sheets("Attendance").Select
If Range("X1") = "T" Then
SplitsOff
AttendanceSplitsOnOff = True
End If
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Sheets("StudentInfo").Select <=****HERE****
If Range("X1") = "T" Then
SplitsOff
StudentInfoSplitsOnOff = True
End If
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
End Sub



.





All times are GMT +1. The time now is 09:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com