Stopping A Macro

  • Thread starter Thread starter Mike Lewis
  • Start date Start date
M

Mike Lewis

I am having a Macro "hang" or I cannot cancel when I run, it has to time
itself out. Here is the code

Dim MyPath As String, FilesInPath As String
Dim myFiles() As String
Dim SourceCcount As Long, FNum As Long
Dim mybook As Workbook, BaseWks As Worksheet
Dim sourceRange As Range, destrange As Range
Dim Cnum As Long, CalcMode As Long


MyPath = ThisWorkbook.Worksheets(1).Range("b10")



If Right(MyPath, 1) <> "\" Then
MyPath = MyPath & "\"
End If
 
I am having a Macro "hang" or I cannot cancel when I run, it has to time
itself out.  Here is the code

  Dim MyPath As String, FilesInPath As String
    Dim myFiles() As String
    Dim SourceCcount As Long, FNum As Long
    Dim mybook As Workbook, BaseWks As Worksheet
    Dim sourceRange As Range, destrange As Range
    Dim Cnum As Long, CalcMode As Long

    MyPath = ThisWorkbook.Worksheets(1).Range("b10")

    If Right(MyPath, 1) <> "\" Then
        MyPath = MyPath & "\"
    End If

Hi

MyPath = ThisWorkbook.Worksheets(1).Range("b10") .Value

Hit CTRL + Break (usually next to "Print Screen") to stop macro

Regards,
Per
 
No, but maybe it could help to insert a breakpoint in the code. Click
on the line where the macro should be halted and hit F9. Click "Run"
to continue the macro.
Also look at the other options in the Debug menu.

Reards,
Per
 
Back
Top