Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
referencing worksheet as a variable
Hello, this is my first post on the website, and I am a newbie at this.
I am trying to do a couple things I guess. First of all, in a macro, am trying to get a hyperlink to reference a worksheet in the sam workbook. The catch is, I have a userform where you have two tex boxes where you input someones first name and someone's last name. Th last name is stored in a variable. I want to use that variable t reference the new worksheet that is created with that last name as th worksheet name. Sub OK_Click() Dim f As String Dim c As String f = First.Text 'reference to my textbox c = Last.Text |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
referencing worksheet as a variable
activeworkbook.worksheets.add.name=c -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "crew3407 " wrote in message ... Hello, this is my first post on the website, and I am a newbie at this. I am trying to do a couple things I guess. First of all, in a macro, I am trying to get a hyperlink to reference a worksheet in the same workbook. The catch is, I have a userform where you have two text boxes where you input someones first name and someone's last name. The last name is stored in a variable. I want to use that variable to reference the new worksheet that is created with that last name as the worksheet name. Sub OK_Click() Dim f As String Dim c As String f = First.Text 'reference to my textbox c = Last.Text |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
referencing worksheet as a variable
I guess I wasn't clear enough? Or maybe I don't understand the answe
given. I was able to add in the sheet already (I used "Move and copy..." t keep formatting the same.) Then I changed the name of the sheet so i would be all uppercase. What I'm having trouble is with th hyperlinking ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="'UCase(c)'!A1", TextToDisplay:=UCase(c) What do I put in the SubAddress so that the Hyperlink that is create will have the correct reference to the sheet that I just created an named by running the macro? I tried putting 'c' in for the workshee name but it didn't work. Am I just missing something? Thanks -- Message posted from http://www.ExcelForum.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
referencing worksheet as a variable
Thanks Bob for helping. I actually figured this one out. Thanks agai
everyone -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Variable cell referencing | Excel Worksheet Functions | |||
Referencing tab based on Variable | Excel Worksheet Functions | |||
Variable Cell Referencing | Excel Worksheet Functions | |||
Referencing Variable Name Worksheets | New Users to Excel | |||
Referencing variable | Excel Programming |