+ Reply to Thread
Results 1 to 5 of 5

Runtime error 9 "subscript out of range"

  1. #1
    Registered User
    Join Date
    01-20-2014
    Location
    Southampton, England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Runtime error 9 "subscript out of range"

    Hi,

    This has cropped up on several other threads but I couldn't find my specific issue hence starting a new thread.

    Essentially I have two workbooks A and B. A is a holding front page which stores data temporarily i then have a macro which copies the data into a central store (workbook B), saves the wookbook and the n closes it. There are several security measures in place to ensure it only copies if B is read/write etc however often people using the tool are getting the 'Runtime error 9 "subscript out of range"' error message. The frustrating bit is it is not everytime its run and it doesn't give me the option to debug to see where its failing over. Also on occassion it leaves workbook B open despite the code specifically closing it after saving.

    Any ideas would be apprieciated

    Chris

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,086

    Re: Runtime error 9 "subscript out of range"

    Might help if you shared your code and, ideally, a sample workbook.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    01-20-2014
    Location
    Southampton, England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Runtime error 9 "subscript out of range"

    Quote Originally Posted by TMShucks View Post
    Might help if you shared your code and, ideally, a sample workbook.


    Regards, TMS
    Sorry I was hoping it would be an obvious error on my part
    Here it is in fullI apprciateits not all needed but I figure I there might be something within casuing it to fall over:

    Sub Portfolio_update()
    If MsgBox("Do you wish to overwrite existing data? This will update entire portfolio", vbYesNo + vbQuestion + vbDefaultButton2, "Confirm Changes") = vbYes Then

    Dim Password As String
    Dim p As String
    Dim t As String

    p = "Please enter password to overwrite data"
    t = "Please enter password"
    Password = InputBox(prompt:=p, Title:=t)
    If UCase(Password) = "R3N3WAL" Then
    Application.ScreenUpdating = False
    'DEFINE AND UPDATE FILES IN HOLDING THAT ARE MARKED "Y"

    'opens datastore ready for update

    LOOPER = 1
    BACKDATE = Day(Now()) & Month(Now()) & Right(Year(Now()), 2) & Minute(Now()) & Hour(Now())

    RETRY:
    Workbooks.Open Filename:= _
    "\\Via\dfs\LIFE\HC\SM\PMP\PIM\CONFIDENTIAL\CONTROLLED ACCESS\SME Transition\renewal FF 2014\Data\Discounting tool data FOR v12.1.xlsx" _
    , UpdateLinks:=0

    If ActiveWorkbook.ReadOnly Then
    If LOOPER > 5 Then

    ActiveWorkbook.Close savechanges:=False


    ANSWER = MsgBox("The Save Failed - Please Try Again", vbExclamation, "MI Conflict")

    Exit Sub
    Else
    ActiveWorkbook.Close savechanges:=False
    LOOPER = LOOPER + 1
    GoTo RETRY
    End If
    End If


    'Select a2 in holding as starting activecell
    Windows("2-49 Renewal tool V12.3.xlsm").Activate
    Sheets("Holding").Visible = True
    Sheets("Holding").Select
    Range("A2").Select

    ' loop through ceels to identify which need updating
    Do Until ActiveCell.Value = ""
    If ActiveCell.Offset(0, 83).Value = "Y" Then
    polnumber = ActiveCell.Value



    Rows(ActiveCell.Row).copy
    'find coresponding data on data store and copy

    Windows("Discounting tool data FOR v12.1.xlsx").Activate
    Range("A3").Select

    REPEAT:


    If ActiveCell.Value = polnumber Then
    ActiveSheet.Paste
    Windows("2-49 Renewal tool V12.3.xlsm").Activate
    Sheets("Holding").Select
    ActiveCell.Offset(1, 0).Select




    Else
    ActiveCell.Offset(1, 0).Select
    GoTo REPEAT

    End If
    Windows("2-49 Renewal tool V12.3.xlsm").Activate
    Sheets("Holding").Select
    'ActiveCell.Offset(1, 0).Select


    Else
    ActiveCell.Offset(1, 0).Select


    End If
    Loop

    'clears change indicators
    Columns("Cf:Cf").Select
    Selection.ClearContents
    Windows("Discounting tool data FOR v12.1.xlsx").Activate
    Columns("Cf:Cf").Select
    Selection.ClearContents
    Range("A1").Select

    '**RELOADS PORTFOLIO TO SHOW CHANGES**

    Windows("2-49 Renewal tool V12.3.xlsm").Activate
    Sheets("Option Sheet").Select
    Consultant = Range("C7").Value
    portdate = Range("C8").Value
    Sheets("Holding").Visible = True
    Sheets("Holding").Select
    Rows("2:4000").Select
    Selection.ClearContents
    Range("A1").Select
    Windows("Discounting tool data FOR v12.1.xlsx").Activate

    Range("a3").EntireRow.Insert
    Dim LastLine As Long
    LastLine = Columns(1).Find("*", , , , xlByColumns, xlPrevious).Row
    Range("A3:cE3").AutoFilter Field:=71, Criteria1:=Consultant

    Range("A3:cE3" & LastLine).SpecialCells(xlCellTypeVisible).copy
    Windows("2-49 Renewal tool V12.3.xlsm").Activate
    Sheets("Holding").Select
    Range("a2").Select
    ActiveSheet.Paste

    'copy into tab so cons can monitor monthly portfolio

    If portdate = "All" Then
    'OPEN AND CLEAR SHEETS
    Sheets("Consultant Portfolio").Visible = True
    Sheets("Consultant Portfolio").Select
    ActiveSheet.Unprotect
    Rows("2:4000").Select
    Selection.ClearContents
    Range("A2").Select
    Sheets("Consultant Portfolio (short)").Visible = True
    Sheets("Consultant Portfolio (short)").Select
    ActiveSheet.Unprotect
    Columns("A:CD").Select
    Selection.EntireColumn.Hidden = False
    Rows("2:4000").Select
    Selection.ClearContents
    Range("A2").Select
    'COPY TO CON PORT
    Sheets("Holding").Select
    Range("A3:CE3").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.copy
    Sheets("Consultant Portfolio").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    ActiveSheet.EnableSelection = xlUnlockedCells
    'COPY TO CON PORT 2 AND HIDE UNWATED COLUMNS
    Sheets("Holding").Select
    Range("A3:CE3").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.copy
    Sheets("Consultant Portfolio (short)").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Columns("B:BH").Select
    Selection.EntireColumn.Hidden = True
    Columns("BK:BK").Select
    Selection.EntireColumn.Hidden = True
    Columns("BU:CD").Select
    Selection.EntireColumn.Hidden = True
    'HIDE AND TIDY HOLDING
    Sheets("Holding").Select
    Range("A2").EntireRow.Delete

    Sheets("Holding").Visible = False
    Application.ScreenUpdating = True
    Sheets("Front Sheet").Visible = True
    Sheets("Front Sheet").Select

    Else
    'OPEN AND CLEAR BOTH SHEETS
    Sheets("Consultant Portfolio").Visible = True
    Sheets("Consultant Portfolio").Select
    ActiveSheet.Unprotect
    Rows("2:4000").Select
    Selection.ClearContents
    Range("A2").Select
    Sheets("Consultant Portfolio (short)").Visible = True
    Sheets("Consultant Portfolio (short)").Select
    ActiveSheet.Unprotect
    Columns("A:CD").Select
    Selection.EntireColumn.Hidden = False
    Rows("2:4000").Select
    Selection.ClearContents
    Range("A2").Select
    'COPY TO CON PORT
    Sheets("Holding").Select
    'Range("a2").EntireRow.Insert

    LastLine = Columns(1).Find("*", , , , xlByColumns, xlPrevious).Row
    Range("A2:ca2").AutoFilter Field:=63, Criteria1:=portdate

    Range("A2:ca" & LastLine).SpecialCells(xlCellTypeVisible).copy
    Sheets("Consultant Portfolio").Select
    Range("A2").Select
    ActiveSheet.Paste
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    ActiveSheet.EnableSelection = xlUnlockedCells
    'COPY TO CON PORT 2 AND HIDE UNWATED COLUMNS
    Sheets("Holding").Select
    'Range("a2").EntireRow.Insert

    LastLine = Columns(1).Find("*", , , , xlByColumns, xlPrevious).Row
    Range("A2:ca2").AutoFilter Field:=63, Criteria1:=portdate

    Range("A2:ca" & LastLine).SpecialCells(xlCellTypeVisible).copy
    Sheets("Consultant Portfolio (short)").Select
    Sheets("Consultant Portfolio (short)").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Columns("B:BH").Select
    Selection.EntireColumn.Hidden = True
    Columns("BK:BK").Select
    Selection.EntireColumn.Hidden = True
    Columns("BU:CD").Select
    Selection.EntireColumn.Hidden = True



    Sheets("Holding").Select
    Range("A2").EntireRow.Delete

    Sheets("Holding").Visible = False
    'Sheets("Option sheet").Visible = False
    Application.ScreenUpdating = True
    Sheets("Front Sheet").Visible = True
    Sheets("Front Sheet").Select

    End If
    'saves all changes to datastore and closes
    Windows("Discounting tool data FOR v12.1.xlsx").Activate
    Range("A3").EntireRow.Delete
    Application.CutCopyMode = False
    ActiveWorkbook.Close savechanges:=True
    Windows("2-49 Renewal tool V12.3.xlsm").Activate
    Sheets("Front Sheet").Select

    RESPONSE = MsgBox("The portfolio has been updated, the sheet can now be closed", vbExclamation, "Fighting Fund Saved")
    Else


    MsgBox "Incorrect Password"
    End If
    End If
    Application.ScreenUpdating = True

    End Sub

    Sub reasignpolicy()
    POL = Range("c14").Value
    Sheets("Holding").Visible = True
    Sheets("Holding").Select
    Rows("2:4000").Select
    Selection.ClearContents
    Range("A1").Select



    LOOPER = 1
    BACKDATE = Day(Now()) & Month(Now()) & Right(Year(Now()), 2) & Minute(Now()) & Hour(Now())

    RETRY:
    Workbooks.Open Filename:= _
    "\\Via\dfs\LIFE\HC\SM\PMP\PIM\CONFIDENTIAL\CONTROLLED ACCESS\SME Transition\renewal FF 2014\Data\Discounting tool data FOR v12.1.xlsx" _
    , UpdateLinks:=0

    If ActiveWorkbook.ReadOnly Then
    If LOOPER > 5 Then
    ActiveWorkbook.Close savechanges:=False
    Sheets("Holding").Visible = False
    Sheets("Option Sheet").Select

    ANSWER = MsgBox("The Save Failed - Please Try Again", vbExclamation, "MI Conflict")

    Exit Sub
    Else
    ActiveWorkbook.Close savechanges:=False
    LOOPER = LOOPER + 1
    GoTo RETRY
    End If
    End If


    Range("A3").Select

    Dim a As Long
    For a = 1 To Cells(Rows.Count, "A").End(xlUp).Row
    If Cells(a, "A").Value = POL Then
    Cells(a, "A").EntireRow.copy Workbooks("2-49 Renewal tool V12.3.xlsm").Sheets("Holding").Cells(Rows.Count, "A").End(xlUp).Offset(1)
    End If
    Next a

    ActiveWorkbook.Close savechanges:=False
    Rows("1:1").Select
    Range(Selection, Selection.End(xlDown)).Select
    ActiveWorkbook.Worksheets("Holding").Sort.SortFields.clear
    ActiveWorkbook.Worksheets("Holding").Sort.SortFields.Add Key:=Range( _
    "Y2:Y4"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
    xlSortNormal
    With ActiveWorkbook.Worksheets("Holding").Sort
    .SetRange Selection
    .Header = xlYes
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
    End With

    Sheets("Holding").Visible = False
    Sheets("Option Sheet").Visible = True
    Application.ScreenUpdating = True
    Sheets("Assign tab").Visible = True
    Sheets("Assign tab").Select


    End Sub
    Sub updatepol()
    'define new values

    newagent = Range("f13").Value
    newcons = Range("f16").Value
    newclus = Range("f19").Value
    Sheets("Holding").Visible = True
    Sheets("Holding").Select
    Range("bs2").Value = newcons
    Range("bt2").Value = newclus
    Range("bu2").Value = newagent
    POL = Range("A2").Value

    'transferto data sheet


    Range("A2:CA2").Select
    Selection.copy
    LOOPER = 1
    BACKDATE = Day(Now()) & Month(Now()) & Right(Year(Now()), 2) & Minute(Now()) & Hour(Now())

    RETRY:
    Workbooks.Open Filename:= _
    "\\Via\dfs\LIFE\HC\SM\PMP\PIM\CONFIDENTIAL\CONTROLLED ACCESS\SME Transition\renewal FF 2014\Data\Discounting tool data FOR v12.1.xlsx" _
    , UpdateLinks:=0

    If ActiveWorkbook.ReadOnly Then
    If LOOPER > 5 Then
    ActiveWorkbook.Close

    ANSWER = MsgBox("The Save Failed - Please Try Again", vbExclamation, "MI Conflict")

    Exit Sub
    Else
    ActiveWorkbook.Close
    LOOPER = LOOPER + 1
    GoTo RETRY
    End If
    End If


    Range("A3").Select

    REPEAT:


    If ActiveCell.Value = POL Then
    Workbooks("2-49 Renewal tool V12.3.xlsm").Activate
    Sheets("HOLDING").Select
    Range("A2:CA2").Select
    Selection.copy
    Windows("Discounting tool data FOR v12.1.xlsx").Activate
    ActiveSheet.Paste
    ActiveWorkbook.Close savechanges:=True
    Else

    ActiveCell.Offset(1, 0).Select
    GoTo REPEAT


    End If


    Windows("2-49 Renewal tool V12.3.xlsm").Activate
    Sheets("HOLDING").Visible = False
    Sheets("assign tab").Select
    Range("d13").Value = ""
    Range("d16").Value = ""
    Range("d19").Value = ""



    Sheets("Assign Tab").Visible = False
    Sheets("Option sheet").Visible = True
    Sheets("Option sheet").Select
    RESPONSE = MsgBox("The portfolio has been updated", vbExclamation, "Fighting Fund Saved")



    End Sub

  4. #4
    Registered User
    Join Date
    01-20-2014
    Location
    Southampton, England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Runtime error 9 "subscript out of range"

    Sorry added far too much code on that one here is just the relavent sub:

    Sub Portfolio_update()
    If MsgBox("Do you wish to overwrite existing data? This will update entire portfolio", vbYesNo + vbQuestion + vbDefaultButton2, "Confirm Changes") = vbYes Then

    Dim Password As String
    Dim p As String
    Dim t As String

    p = "Please enter password to overwrite data"
    t = "Please enter password"
    Password = InputBox(prompt:=p, Title:=t)
    If UCase(Password) = "R3N3WAL" Then
    Application.ScreenUpdating = False
    'DEFINE AND UPDATE FILES IN HOLDING THAT ARE MARKED "Y"

    'opens datastore ready for update

    LOOPER = 1
    BACKDATE = Day(Now()) & Month(Now()) & Right(Year(Now()), 2) & Minute(Now()) & Hour(Now())

    RETRY:
    Workbooks.Open Filename:= _
    "\\Via\dfs\LIFE\HC\SM\PMP\PIM\CONFIDENTIAL\CONTROLLED ACCESS\SME Transition\renewal FF 2014\Data\Discounting tool data FOR v12.1.xlsx" _
    , UpdateLinks:=0

    If ActiveWorkbook.ReadOnly Then
    If LOOPER > 5 Then

    ActiveWorkbook.Close savechanges:=False


    ANSWER = MsgBox("The Save Failed - Please Try Again", vbExclamation, "MI Conflict")

    Exit Sub
    Else
    ActiveWorkbook.Close savechanges:=False
    LOOPER = LOOPER + 1
    GoTo RETRY
    End If
    End If


    'Select a2 in holding as starting activecell
    Windows("2-49 Renewal tool V12.3.xlsm").Activate
    Sheets("Holding").Visible = True
    Sheets("Holding").Select
    Range("A2").Select

    ' loop through ceels to identify which need updating
    Do Until ActiveCell.Value = ""
    If ActiveCell.Offset(0, 83).Value = "Y" Then
    polnumber = ActiveCell.Value



    Rows(ActiveCell.Row).copy
    'find coresponding data on data store and copy

    Windows("Discounting tool data FOR v12.1.xlsx").Activate
    Range("A3").Select

    REPEAT:


    If ActiveCell.Value = polnumber Then
    ActiveSheet.Paste
    Windows("2-49 Renewal tool V12.3.xlsm").Activate
    Sheets("Holding").Select
    ActiveCell.Offset(1, 0).Select




    Else
    ActiveCell.Offset(1, 0).Select
    GoTo REPEAT

    End If
    Windows("2-49 Renewal tool V12.3.xlsm").Activate
    Sheets("Holding").Select
    'ActiveCell.Offset(1, 0).Select


    Else
    ActiveCell.Offset(1, 0).Select


    End If
    Loop

    'clears change indicators
    Columns("Cf:Cf").Select
    Selection.ClearContents
    Windows("Discounting tool data FOR v12.1.xlsx").Activate
    Columns("Cf:Cf").Select
    Selection.ClearContents
    Range("A1").Select

    '**RELOADS PORTFOLIO TO SHOW CHANGES**

    Windows("2-49 Renewal tool V12.3.xlsm").Activate
    Sheets("Option Sheet").Select
    Consultant = Range("C7").Value
    portdate = Range("C8").Value
    Sheets("Holding").Visible = True
    Sheets("Holding").Select
    Rows("2:4000").Select
    Selection.ClearContents
    Range("A1").Select
    Windows("Discounting tool data FOR v12.1.xlsx").Activate

    Range("a3").EntireRow.Insert
    Dim LastLine As Long
    LastLine = Columns(1).Find("*", , , , xlByColumns, xlPrevious).Row
    Range("A3:cE3").AutoFilter Field:=71, Criteria1:=Consultant

    Range("A3:cE3" & LastLine).SpecialCells(xlCellTypeVisible).copy
    Windows("2-49 Renewal tool V12.3.xlsm").Activate
    Sheets("Holding").Select
    Range("a2").Select
    ActiveSheet.Paste

    'copy into tab so cons can monitor monthly portfolio

    If portdate = "All" Then
    'OPEN AND CLEAR SHEETS
    Sheets("Consultant Portfolio").Visible = True
    Sheets("Consultant Portfolio").Select
    ActiveSheet.Unprotect
    Rows("2:4000").Select
    Selection.ClearContents
    Range("A2").Select
    Sheets("Consultant Portfolio (short)").Visible = True
    Sheets("Consultant Portfolio (short)").Select
    ActiveSheet.Unprotect
    Columns("A:CD").Select
    Selection.EntireColumn.Hidden = False
    Rows("2:4000").Select
    Selection.ClearContents
    Range("A2").Select
    'COPY TO CON PORT
    Sheets("Holding").Select
    Range("A3:CE3").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.copy
    Sheets("Consultant Portfolio").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    ActiveSheet.EnableSelection = xlUnlockedCells
    'COPY TO CON PORT 2 AND HIDE UNWATED COLUMNS
    Sheets("Holding").Select
    Range("A3:CE3").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.copy
    Sheets("Consultant Portfolio (short)").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Columns("B:BH").Select
    Selection.EntireColumn.Hidden = True
    Columns("BK:BK").Select
    Selection.EntireColumn.Hidden = True
    Columns("BU:CD").Select
    Selection.EntireColumn.Hidden = True
    'HIDE AND TIDY HOLDING
    Sheets("Holding").Select
    Range("A2").EntireRow.Delete

    Sheets("Holding").Visible = False
    Application.ScreenUpdating = True
    Sheets("Front Sheet").Visible = True
    Sheets("Front Sheet").Select

    Else
    'OPEN AND CLEAR BOTH SHEETS
    Sheets("Consultant Portfolio").Visible = True
    Sheets("Consultant Portfolio").Select
    ActiveSheet.Unprotect
    Rows("2:4000").Select
    Selection.ClearContents
    Range("A2").Select
    Sheets("Consultant Portfolio (short)").Visible = True
    Sheets("Consultant Portfolio (short)").Select
    ActiveSheet.Unprotect
    Columns("A:CD").Select
    Selection.EntireColumn.Hidden = False
    Rows("2:4000").Select
    Selection.ClearContents
    Range("A2").Select
    'COPY TO CON PORT
    Sheets("Holding").Select
    'Range("a2").EntireRow.Insert

    LastLine = Columns(1).Find("*", , , , xlByColumns, xlPrevious).Row
    Range("A2:ca2").AutoFilter Field:=63, Criteria1:=portdate

    Range("A2:ca" & LastLine).SpecialCells(xlCellTypeVisible).copy
    Sheets("Consultant Portfolio").Select
    Range("A2").Select
    ActiveSheet.Paste
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    ActiveSheet.EnableSelection = xlUnlockedCells
    'COPY TO CON PORT 2 AND HIDE UNWATED COLUMNS
    Sheets("Holding").Select
    'Range("a2").EntireRow.Insert

    LastLine = Columns(1).Find("*", , , , xlByColumns, xlPrevious).Row
    Range("A2:ca2").AutoFilter Field:=63, Criteria1:=portdate

    Range("A2:ca" & LastLine).SpecialCells(xlCellTypeVisible).copy
    Sheets("Consultant Portfolio (short)").Select
    Sheets("Consultant Portfolio (short)").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Columns("B:BH").Select
    Selection.EntireColumn.Hidden = True
    Columns("BK:BK").Select
    Selection.EntireColumn.Hidden = True
    Columns("BU:CD").Select
    Selection.EntireColumn.Hidden = True



    Sheets("Holding").Select
    Range("A2").EntireRow.Delete

    Sheets("Holding").Visible = False
    'Sheets("Option sheet").Visible = False
    Application.ScreenUpdating = True
    Sheets("Front Sheet").Visible = True
    Sheets("Front Sheet").Select

    End If
    'saves all changes to datastore and closes
    Windows("Discounting tool data FOR v12.1.xlsx").Activate
    Range("A3").EntireRow.Delete
    Application.CutCopyMode = False
    ActiveWorkbook.Close savechanges:=True
    Windows("2-49 Renewal tool V12.3.xlsm").Activate
    Sheets("Front Sheet").Select

    RESPONSE = MsgBox("The portfolio has been updated, the sheet can now be closed", vbExclamation, "Fighting Fund Saved")
    Else


    MsgBox "Incorrect Password"
    End If
    End If
    Application.ScreenUpdating = True

    End Sub

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Runtime error 9 "subscript out of range"

    Hi PUZEYQUIN,

    Which line is being highlighted and:

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Runtime error 9 "subscript out of range"
    By Frustratedemployee in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-30-2013, 06:48 PM
  2. Runtime error 9 "subscript out of range"
    By eLakmal in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-08-2013, 10:09 PM
  3. [SOLVED] Runtime error 9 "subscript out of range"
    By MyCousinVinnie in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-08-2012, 11:28 PM
  4. Error msgs: "Object varible or with block variable not set"; "subscript out of range"
    By menyanthe in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-26-2009, 04:58 PM
  5. [SOLVED] "Subscript out of range" error for: Workbooks("Test1.xls").Save
    By Just12341234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2005, 11:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1