Stopping A Macro

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
 
P

Per Jessen

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
 
P

Per Jessen

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

help with merging worksheets 3
Open CSV File 4
Macro Help!!!!!! 2
Copy non-contiguous cells from all workbooks in folder 8
Import Data from Multiple Sources 8
Windows XP vba code help 10
NEED HELP!!!! 1
Get data reference to last row 5

Top