hallpett
asked on
Use VBA to find the name of the first sheet in a workbook
How can I use vba to find the name of the first sheet in a workbook?
I use this code to copy from the first sheet to another sheet in the workbook:
Sheets("Sheet1").Range("b1 0:d10").Co py Sheets("Sales").Range("B2" )
What I want is to use some vba code to return name of the first sheet in the workbook to a vaiable that I can use in the code. Something like this:
strFirstSheet = "somehow find name of first sheet"
Sheets(strFirstSheet).Rang e("b10:d10 ").Copy Sheets("Sales").Range("B2" )
Maybe a strange problem but it makes sense in my setting. Appreciate any help.
I use this code to copy from the first sheet to another sheet in the workbook:
Sheets("Sheet1").Range("b1
What I want is to use some vba code to return name of the first sheet in the workbook to a vaiable that I can use in the code. Something like this:
strFirstSheet = "somehow find name of first sheet"
Sheets(strFirstSheet).Rang
Maybe a strange problem but it makes sense in my setting. Appreciate any help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window