Results 1 to 5 of 5

Getting VBA Run time error '9' on only some machines

Threaded View

  1. #1
    Registered User
    Join Date
    09-28-2021
    Location
    Johannesburg, South Africa
    MS-Off Ver
    EXcel for Office 365
    Posts
    2

    Getting VBA Run time error '9' on only some machines

    I've created a macro to check text in a Purchase Order (Copied into a sheet "PO_Text") and return certain values from the text. The following code works well on a number of PC's, but not on some. When running the macro, I get the Runtime Error '9' Subscript out of range on the highlighted line. I've not been able to replicate the error on my PC and the users that experiences the issue work remotely, so difficult to do fault finding.

    Any ideas as to what the problem is are welcome.

    Sub Check_PO()
    '
    ' Check_PO Macro
    '
    
        Sheets("PO_Check_Report").Activate
        Range("B3:B4").ClearContents
        Rows("8:4000").ClearContents
    
        Sheets("PO_text").Select
        LastRow = Worksheets("PO_text").Range("A24000").End(xlUp).Row
        MasterListLastRow = Worksheets("Master_List").Range("B3").End(xlDown).Row
        NotFoundNextRow = Worksheets("PO_Check_Report").Range("A6").End(xlDown).Row + 1
        FoundDifNextRow = Worksheets("PO_Check_Report").Range("D6").End(xlDown).Row + 1
        FoundOKNextRow = Worksheets("PO_Check_Report").Range("G6").End(xlDown).Row + 1
        
      '  Find PO Number in text
        Cells(1, 1).Activate
        Cells.Find(What:="PO Number", After:=ActiveCell, LookIn:=xlFormulas2, _
            LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
            MatchCase:=False, SearchFormat:=False).Activate
        ActiveCell.Offset(1, 0).Activate
        Purch_No = InStr(1, ActiveCell.Value, "/", vbTextCompare)
        PO_Number = Left(ActiveCell.Value, Purch_No - 2)
        Sheets("PO_Check_Report").Range("B3").Value = PO_Number
        Sheets("PO_Check_Report").Range("B4").Value = Now()
    Last edited by AliGW; 09-28-2021 at 05:40 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Production Calculator... work out time to produce and how many machines
    By pmw19800 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-08-2019, 12:21 PM
  2. 'Can't exit design mode' error when workbook opened on some machines only!
    By MathUKTeacher in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-17-2015, 05:40 PM
  3. [SOLVED] Run-Time Error 1004 on Certain Machines
    By yay_excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2015, 01:32 PM
  4. Down time for machines at work in military time not adding up.
    By joshuawcolvey in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-02-2014, 11:08 AM
  5. run-time error ;2147023179 (800706b5) time automation error interface unknown
    By karthik72 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-02-2012, 09:31 AM
  6. Macro for finding Overlapping duration of all the machines in service at a time
    By welsel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2012, 06:12 AM
  7. Macros giving Run-time error '9' on all machines except mine
    By WinterCoast in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-17-2008, 12:56 PM

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