I know how to rename a sheet when I already know what the sheet name is going to be. For example I geta weekly file from an external source and I rename it as follows.
But now I'm also exporting data from another system. I save it as "My data" each time, overwriting the previous copy, but the sheet name is a long string of characters such as "4d604f91760a4a3c80d416ad6a192f5" which changes each time.
So how do I say something like this?
Sheets("whatever_its_called").Select
Sheets("whatever_its_called").Name = "Sheet1"
Code:
'Rename sheet in Study Summary
Workbooks.Open Filename:= _
"G:\Database\Database files\Study Summary.xlsx"
Sheets("Study SummaryDATA").Select
Sheets("Study SummaryDATA").Name = "Study Summary"
Range("A1").Select
ActiveWorkbook.Save
ActiveWindow.Close
But now I'm also exporting data from another system. I save it as "My data" each time, overwriting the previous copy, but the sheet name is a long string of characters such as "4d604f91760a4a3c80d416ad6a192f5" which changes each time.
So how do I say something like this?
Sheets("whatever_its_called").Select
Sheets("whatever_its_called").Name = "Sheet1"