asunwatcher
New Member
- Joined
- Oct 9, 2010
- Messages
- 24
I'm writing a function that gets data from a worksheet with a name dependant of the value of a cell. The cells value (e.g. Sheet1) is called into the function as string_name.
Essentially I want to transform this code
into something like this
I realise it's probably a silly question, but I've been unsuccessful in implementing this for a few hours now...help would be greatly appreciated.
Essentially I want to transform this code
Code:
xrange = Sheets("Sheet1").Range("I2:I20").Value
into something like this
Code:
xrange = Sheets(string_name).Range("I2:I20").Value
I realise it's probably a silly question, but I've been unsuccessful in implementing this for a few hours now...help would be greatly appreciated.