+ Reply to Thread
Results 1 to 4 of 4

unkown change has caused marco to become erratic

  1. #1
    Registered User
    Join Date
    05-27-2015
    Location
    london
    MS-Off Ver
    2003
    Posts
    22

    unkown change has caused marco to become erratic

    Using windows 10 with office 2003.

    Built quite a complicated set of multiple macros in excel to perform a specific function 3 years ago and installed it onto 2 different computers. Used daily, all has worked fine until this week when one of the computers now generates a runtime error at a specific part of the code but not all the time. The code is identical on both machines but the other one still works perfectly. The source data is downloaded from a website as a csv, opened in excel and the macro sorts the data into a specific order I have searched for differences in the machines with little success. The source data is the same for both machines and no known updates have taken place recently. This is what I have tried so far. .

    On the machine it’s failing on;

    Rolled back the last windows update.
    Firefox update is latest on failed machine and previous on working machine. Have tried download from Opera and Edge but still generally fails.
    Checked security settings and all other settings are the same.
    Pasted working code over failed code and saved even though it’s the same.


    Today I am going to take a copy of excel from the working machine and set the path to it on the non working machine.

    I have also visually compared the results of several working and failed sheets but can see no common issue as why one computer works fine and the other fails. It makes no sense at all. I am certain the coding is fine but something is making it fail and then sometimes it just runs fine?? Any suggestions please

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: unkown change has caused marco to become erratic

    What's the error?

  3. #3
    Registered User
    Join Date
    05-27-2015
    Location
    london
    MS-Off Ver
    2003
    Posts
    22

    Re: unkown change has caused marco to become erratic

    IMG_0467.jpg

    This is the error but sometimes it works fine. The range is 1-500 lines

  4. #4
    Registered User
    Join Date
    05-27-2015
    Location
    london
    MS-Off Ver
    2003
    Posts
    22

    Re: unkown change has caused marco to become erratic

    This is the offending line of code.

    Sub HERMCombaddress2()
    Dim X As Integer

    For X = 1 To 500
    Cells(X, 31).Value = Cells(X, 11).Value & " " & Cells(X, 5).Value
    If InStr(Cells(X, 3), "_") > 0 Then
    Cells(X, 11).Value = Left(Cells(X, 11), (InStr(Cells(X, 11), "_")) - 1)
    End If
    Next X
    End Sub

    I takes the address values in several cells and combines them into one cell. Works perfectly normally but not now.

+ 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. [SOLVED] Trying to add a change to a VBA marco
    By justinwb in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-20-2018, 05:38 AM
  2. Equation solving with one unkown
    By Pelikan in forum Excel General
    Replies: 4
    Last Post: 11-29-2016, 10:15 AM
  3. How to Run a Macro Based on Change in a cell caused by incoming Real-Time Server Data
    By taxkinginc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-18-2016, 05:00 AM
  4. [SOLVED] Worksheet_Change/SelectionChange: Detect if a has a filter caused the change?
    By brucemc777 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-14-2016, 07:54 PM
  5. Can VBA reference change in cell value caused by formula?
    By gabbana in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2016, 11:44 AM
  6. [SOLVED] Looping through unkown sheet names
    By amoxia in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-29-2014, 02:57 AM
  7. SUMIF with a list of unkown criteria
    By londbrit in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-18-2011, 05:57 PM

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