View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default 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