jordanburch
Active Member
- Joined
- Jun 10, 2016
- Messages
- 440
- Office Version
- 2016
hey guys i have the following code. I have tried several solutions but nothing seems to work. in column ad of wb2 i want the file name and the tab name to be inserted. They can be in different columns if that makes it easier. Any help is greatly appreciated.
If SheetExists(CStr(shArr(i)), wb2) Then
erow = ThisWorkbook.Sheets("DRP").Range("A" & Rows.Count).End(xlUp).Row + 1
With .Sheets(shArr(i))
If .AutoFilterMode = True Then .AutoFilterMode = False
wb2.Sheets(LCase(.Name)).Range("ad2:ad1000").Value = MyFile
If LCase(.Name) = "details" Then
.Range("D2:AF1000").Copy Destination:=ThisWorkbook.Worksheets("DRP").Cells(erow, 1)
Else
.Range("C2:AF1000").Copy Destination:=ThisWorkbook.Worksheets("DRP").Cells(erow, 1)
End If
End With
Jordan
If SheetExists(CStr(shArr(i)), wb2) Then
erow = ThisWorkbook.Sheets("DRP").Range("A" & Rows.Count).End(xlUp).Row + 1
With .Sheets(shArr(i))
If .AutoFilterMode = True Then .AutoFilterMode = False
wb2.Sheets(LCase(.Name)).Range("ad2:ad1000").Value = MyFile
If LCase(.Name) = "details" Then
.Range("D2:AF1000").Copy Destination:=ThisWorkbook.Worksheets("DRP").Cells(erow, 1)
Else
.Range("C2:AF1000").Copy Destination:=ThisWorkbook.Worksheets("DRP").Cells(erow, 1)
End If
End With
Jordan