FROGGER24
Well-known Member
- Joined
- May 22, 2004
- Messages
- 704
- Office Version
- 2013
- 2010
- Platform
- Windows
I am using this piece of code that I need to modify that if worksheet "receipts" is not found then go to the next closed workbook...
Sub GetMyData()
Dim myDir As String, fn As String, sn As String, NR As Long
myDir = "c:\test1"
sn = "receipts"
fn = Dir(myDir & "\*.xls")
NR = 1
Do While fn <> ""
If fn <> ThisWorkbook.Name Then
With ThisWorkbook.Sheets("Sheet1")
NR = NR + 1
Thanks for any help!
Sub GetMyData()
Dim myDir As String, fn As String, sn As String, NR As Long
myDir = "c:\test1"
sn = "receipts"
fn = Dir(myDir & "\*.xls")
NR = 1
Do While fn <> ""
If fn <> ThisWorkbook.Name Then
With ThisWorkbook.Sheets("Sheet1")
NR = NR + 1
Thanks for any help!