Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Run time error 9 (Subscript Out Of Range)

Hi,

I am writing a macro for a report.

I need to navigate from one report to an another report to collect the
data. My macro gets stuck-up on this paticular code every time. (Run
time error 9, Subscript Out Of Range)

Windows("Hiring Plan.xls").Activate

I have also tried other alternatives as well. For example but
Workbooks("Hiring Plan.xls").Sheets("C LLC").Range("A2").Activate

I dont understant why it is happening. Please help.

Private Sub RamPlan()

Workbooks("Ramp Plan Macro.xls").Activate
Sheets("Macro").Select

Dim hirePath As String
Dim ramppath As String
Dim hirename As String
Dim rampName As String

hirePath = Range("c8").Value
ramppath = Range("c9").Value
hirename = Range("c10").Value
rampName = Range("c11").Value


Workbooks.Open ramppath & "\" & rampName
Workbooks.Open hirePath & "\" & hirename

Dim fromdate As Variant
fromdate = Workbooks("Ramp Plan
Macro.xls").Sheets("Macro").Range("c13").Value
Windows("Hiring Plan.xls").Activate

Do Until ActiveCell.Value = fromdate
Selection.Offset(1, 0).Select
Loop

Selection.Offset(0, 5).Select
If ActiveCell.Value = "" Then
Call CCTTrainer
End If

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Run time error 9 (Subscript Out Of Range)

Hi Heera, I saw your previous posting and some of the replies. When you get
that particular error message, VBA is telling you that it cannot find the
name that you are calling for one or more of the following reasons:

1. The Object does not exist.
2. The name being used to call the object is misspelled, uses the wrong
case, has spaces, don't have spaces or in some other way is different than
the actual object name.
3. The applicable file is not open.

It can be something as simple as forgetting to include the Quotation marks
for a string or, conversely, using quotation marks for a variable.

Good hunting.

"Heera" wrote:

Hi,

I am writing a macro for a report.

I need to navigate from one report to an another report to collect the
data. My macro gets stuck-up on this paticular code every time. (Run
time error 9, Subscript Out Of Range)

Windows("Hiring Plan.xls").Activate

I have also tried other alternatives as well. For example but
Workbooks("Hiring Plan.xls").Sheets("C LLC").Range("A2").Activate

I dont understant why it is happening. Please help.

Private Sub RamPlan()

Workbooks("Ramp Plan Macro.xls").Activate
Sheets("Macro").Select

Dim hirePath As String
Dim ramppath As String
Dim hirename As String
Dim rampName As String

hirePath = Range("c8").Value
ramppath = Range("c9").Value
hirename = Range("c10").Value
rampName = Range("c11").Value


Workbooks.Open ramppath & "\" & rampName
Workbooks.Open hirePath & "\" & hirename

Dim fromdate As Variant
fromdate = Workbooks("Ramp Plan
Macro.xls").Sheets("Macro").Range("c13").Value
Windows("Hiring Plan.xls").Activate

Do Until ActiveCell.Value = fromdate
Selection.Offset(1, 0).Select
Loop

Selection.Offset(0, 5).Select
If ActiveCell.Value = "" Then
Call CCTTrainer
End If

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Run time error 9 (Subscript Out Of Range)

But you said it was working fine, then all you did was restate the problem,
not which of the suggestions you tried that didn't work.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Heera" wrote in message
...
Hi,

I am writing a macro for a report.

I need to navigate from one report to an another report to collect the
data. My macro gets stuck-up on this paticular code every time. (Run
time error 9, Subscript Out Of Range)

Windows("Hiring Plan.xls").Activate

I have also tried other alternatives as well. For example but
Workbooks("Hiring Plan.xls").Sheets("C LLC").Range("A2").Activate

I dont understant why it is happening. Please help.

Private Sub RamPlan()

Workbooks("Ramp Plan Macro.xls").Activate
Sheets("Macro").Select

Dim hirePath As String
Dim ramppath As String
Dim hirename As String
Dim rampName As String

hirePath = Range("c8").Value
ramppath = Range("c9").Value
hirename = Range("c10").Value
rampName = Range("c11").Value


Workbooks.Open ramppath & "\" & rampName
Workbooks.Open hirePath & "\" & hirename

Dim fromdate As Variant
fromdate = Workbooks("Ramp Plan
Macro.xls").Sheets("Macro").Range("c13").Value
Windows("Hiring Plan.xls").Activate

Do Until ActiveCell.Value = fromdate
Selection.Offset(1, 0).Select
Loop

Selection.Offset(0, 5).Select
If ActiveCell.Value = "" Then
Call CCTTrainer
End If

End Sub



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
Run time error 9 (Subscript Out Of Range) Heera Excel Programming 4 May 13th 08 07:30 PM
run time error 9, subscript out of range [email protected] Excel Programming 6 July 7th 06 02:35 AM
run-time error '9': Subscript out of range jerredjohnson[_2_] Excel Programming 1 March 8th 06 07:11 PM
Run-time error 9 (Subscript out of range) Lizz45ie[_3_] Excel Programming 3 October 26th 05 11:38 PM
Run time error 9 (subscript out of range) Nathaniel Tigere Excel Programming 2 August 5th 03 11:12 AM


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