Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,590
- Office Version
- 365
- 2016
- Platform
- Windows
I have code that opens up a second workbook. Since the second workbook is variable named, I use a formula to name the workbook name.
wshT is workbook1, C2 is user inputted date.
wshcore_staff is the staff worksheet of the workbook resulting from sfname. (This workbook has been previously opened in earlier code)
I need to copy the contents only of a range of cells (B4-B10) from wshcore_staff to wshT cell C5.
I think it's an easy solution, but I'm drawing a blank.
I wish to
Code:
With wshT.Range("C2")
sfname = Format(.Value, "00000") & "(" & Format(.Value, "dd-mmmm-yy") & ").xls"
Set wshcore_staff = Workbooks(sfname).Worksheets("STAFF")
End With
wshcore_staff is the staff worksheet of the workbook resulting from sfname. (This workbook has been previously opened in earlier code)
I need to copy the contents only of a range of cells (B4-B10) from wshcore_staff to wshT cell C5.
I think it's an easy solution, but I'm drawing a blank.
I wish to