I'm working on creating a template workbook to create a worksheet with the current date and then bring in a previous day's report for comparison. Prior to the code below running, the workbook is renamed and sheet1 is renamed "User Accounts 10-31-18."
The closed workbook is a previous report so has sheet1 named "User Accounts 10-30-18" I'm not knowledgeable enough to select the worksheets to copy using a partial string so elected to use sheet1.
Abbreviated code after choosing and accessing the closed work:
However instead of a worksheet named "User Accounts 10-30-18" the imported worksheet is named "User Accounts 10-31-18 (1)"
Options for fixing this?
TIA
Ron
The closed workbook is a previous report so has sheet1 named "User Accounts 10-30-18" I'm not knowledgeable enough to select the worksheets to copy using a partial string so elected to use sheet1.
Abbreviated code after choosing and accessing the closed work:
Code:
Dim otherwb As Workbook
Dim thiswb As Workbook
Dim otherws1 As Worksheet
otherwb.Activate
Set otherws1 = Sheet1
otherws1.Activate
otherws1.Copy After:=Thiswb.Sheets(Thiswb.Sheets.Count)
However instead of a worksheet named "User Accounts 10-30-18" the imported worksheet is named "User Accounts 10-31-18 (1)"
Options for fixing this?
TIA
Ron