Hello everybody !
First at all, please apologize my english.
I have a file with up to 40 worksheets, and I want to find a way to define a range in a WorkSheet using a string as the name of the worksheet.
Do you know how to do it guys ?![]()
Hello everybody !
First at all, please apologize my english.
I have a file with up to 40 worksheets, and I want to find a way to define a range in a WorkSheet using a string as the name of the worksheet.
Do you know how to do it guys ?![]()
Do you mean this:
![]()
Sub Example() Dim myRange As Range Dim myString As String myString = "Summary" Set myRange = Sheets(myString).Range("A1:A10") 'arbitrary range End Sub
Thank you a lot, it works. Do you know if I can use myRange in a Vlookup function ?
![]()
Sal = Application.WorksheetFunction.VLookup(startingdate, myRange, 3, False)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks