Excel 2003 VBA Automaticaly Loops

tbello

New Member
Joined
Mar 30, 2011
Messages
4
I have written a lengthy macro in Excel 2003, approximately 1,300 lines. The macro has been running without any glitches until today. It now loops to the beginning without being prompted to. If I place an "Exit Sub" a few lines before the end of the macro, it does not loop. I do have a "GoTo" within the macro that goes to the line directly above "End Sub".
 

Some videos you may like

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

texasalynn

Well-known Member
Joined
May 19, 2002
Messages
8,458
Welcome to MrExcel board...

I would suggest that you step through the macro and see where it might be failing. (goto macros click the one you need and then click on step into then use the F8 key for every line in the macro)
 

MrKowz

Well-known Member
Joined
Jun 30, 2008
Messages
6,653
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Welcome to the forums!

Can you please provide the code so we can debug it?
 

tbello

New Member
Joined
Mar 30, 2011
Messages
4
Not sure what happened, but I deleted a few lines and the code does not loop anymore - very odd. I am written alot of code but have never seen that.
 

Watch MrExcel Video

Forum statistics

Threads
1,109,433
Messages
5,528,738
Members
409,831
Latest member
KT50

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top