tanyaleblanc
Board Regular
- Joined
- Mar 16, 2019
- Messages
- 145
Hi, when I open a file within a macro, I'm typically hitting F8 so that I can see if all the step are working properly, but when I open a file within the macro, it runs the macro fully, is there anyway to prevent this so that I can just keep hitting F8 to see if I have an errors and the information is working correctly.
[ub Filter()Dim lRow As Long
Dim fd As Office.FileDialog
lRow = ActiveSheet.Range("A500").End(xlUp).Row
If AutoFilterMode = True And FilterMode = True Then ActiveSheet.ShowAllData
lRow = ActiveSheet.Range("A500").End(xlUp).Row
Range("B9").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[2],'[Finance Extract1.xls]Sheet1'!R8C4:R500C4,1,FALSE)"
Selection.AutoFill Destination:=Range("B9:B500")
Range("B9:B500").Select
Set fd = Application.FileDialog(msoFileDialogFilePicker)
'open finance rec
With fd
.AllowMultiSelect = False
.Title = "Please select the file."
.Filters.Clear
If .Show = True Then
txtfilename = .SelectedItems(1)
Workbooks.Open txtfilename
End If]
[ub Filter()Dim lRow As Long
Dim fd As Office.FileDialog
lRow = ActiveSheet.Range("A500").End(xlUp).Row
If AutoFilterMode = True And FilterMode = True Then ActiveSheet.ShowAllData
lRow = ActiveSheet.Range("A500").End(xlUp).Row
Range("B9").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[2],'[Finance Extract1.xls]Sheet1'!R8C4:R500C4,1,FALSE)"
Selection.AutoFill Destination:=Range("B9:B500")
Range("B9:B500").Select
Set fd = Application.FileDialog(msoFileDialogFilePicker)
'open finance rec
With fd
.AllowMultiSelect = False
.Title = "Please select the file."
.Filters.Clear
If .Show = True Then
txtfilename = .SelectedItems(1)
Workbooks.Open txtfilename
End If]