Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've renamed my worksheets in the VBE properties window ("Apple", "Pear",
"Melon"); in the Excel user view, they still show up as "sheet1", sheet2", and "sheet3". Now in my VBA I need to refer to a range on a selected sheet. If I hardcode it, I can use: Apple.Range("B4:F17").Select but I'm pulling in the appropriate sheet name as a text string, "Apple" or "Pear" or "Melon". How do I use this dynamically? I'm sure it is something close to: Dim oWrkSht as Worksheet Set oWrkSht = "Apple" oWrkSht.Range("B4:F17").Select but I get a type mismatch, because the sheet can't be set to a string... I'm sure there is an easy way to do this... Thanks, Keith -- The enclosed questions or comments are entirely mine and don't represent the thoughts, views, or policy of my employer. Any errors or omissions are my own. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Easy question - copying worksheet and keeping formulas | Excel Discussion (Misc queries) | |||
new user with easy question? not easy for me | New Users to Excel | |||
Easy VBA Syntax Question | Excel Programming | |||
Easy VBA Syntax Question | Excel Programming | |||
Syntax when referring to self | Excel Programming |