rkbengineer
06-15-2006, 09:17 AM
Hi,
I'm relatively new to VBA, however I have done a fair bit of Basic & QuickBasic progamming several years ago. I have a problem that I haven't been able to find in a book or any forum.
I have a workbook with 6 worksheets w/ unique names assigned to them. I have a userform that requires several inputs. One input (a TextBox) is a number from 1 to 6. Based on the input, a worksheet should be made active. For example, if a "1" is entered, then the worksheet named "1st" would be activated, "2" for "2nd", etc. My problem is that I don't know how to assign a variable to the worksheet name. I can assign a name from a cell entry, a direct entry or the default, but not from a variable input.
As an afterthought, since there are only 6 possibilities, would it be easier to select from 6 OptionButtons? I might could manage that easier...
Any help would be appreciated. I'm sure I'll have more questions as I go along.
Thanks.
I'm relatively new to VBA, however I have done a fair bit of Basic & QuickBasic progamming several years ago. I have a problem that I haven't been able to find in a book or any forum.
I have a workbook with 6 worksheets w/ unique names assigned to them. I have a userform that requires several inputs. One input (a TextBox) is a number from 1 to 6. Based on the input, a worksheet should be made active. For example, if a "1" is entered, then the worksheet named "1st" would be activated, "2" for "2nd", etc. My problem is that I don't know how to assign a variable to the worksheet name. I can assign a name from a cell entry, a direct entry or the default, but not from a variable input.
As an afterthought, since there are only 6 possibilities, would it be easier to select from 6 OptionButtons? I might could manage that easier...
Any help would be appreciated. I'm sure I'll have more questions as I go along.
Thanks.