Hi Guys!
I'm sure yall can help me with this dilemma. I have a workbook with 9 macros calling each other step by step... for instance, Macro 1 runs its code then when done, calls Macro 2...etc... until everything is set. I have checked the code and nothing calls itself...at least that's what I think.
Here's where the error happens:
Sub Day_6()
'Get Data for (Day 6)
Range("A1").Select
ActiveCell.Offset(0, 6).Select
Cells.Find(What:=ActiveCell.Value, after:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Set Sh = ActiveSheet
On Error Resume Next
Do While Sh.Next.Visible <> xlSheetVisible
If Err <> 0 Then Exit Do
Set Sh = Sh.Next
Loop
Sh.Next.Activate
On Error GoTo 0
On Error GoTo ErrHandler:
Cells.FindNext(after:=ActiveCell).Activate
On Error GoTo 0
Range(ActiveCell.Offset(1, 0), ActiveCell.Offset(3, 0)).Copy
VBA_Sheet.Select
Cells(Rows.Count, 7).End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)
ActiveCell.Delete shift:=xlUp
ActiveCell.Value = Left(ActiveCell.Value, 12)
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = Val(ActiveCell.Value)
If ActiveCell.Value > Range("M1").Value Then
ActiveCell.Interior.ColorIndex = 3
ActiveCell.Value = Range("M1").Value
'ActiveCell.Offset(0, 1).Select
Else
ActiveCell.Value = ActiveCell.Value
ActiveCell.Interior.ColorIndex = 4
'ActiveCell.Offset(0, 1).Select
End If
Day_7
Exit Sub
ErrHandler:
VBA_Sheet.Select
Cells(Rows.Count, 7).End(xlUp).Offset(1, 0).Select
Selection.Value = "-"
ActiveCell.Offset(1, 0).Select
Selection.Value = "-"
Call Day_7
End Sub
Display More
So when i run the macros, It starts of with a Macro called
then calls
through
then calls
then goes back to
.
After the macros loop several times, I get an error saying Out of Stack Space then when I click debug, it directs me to the line
the one above
.
I have checked the Call Stack and it is filled to the brim!
I have been scouring the internet for a solution, but I just can't find one.
I am hoping you can shed light to my issue.
Please know that I am not an expert on this, and you might just find my code poorly written. Nevertheless, I am open to learning new things from you.
Warm Regards,
JC