View Single Post
  #17   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Renaming an excel sheet based upon an action

I don't understand what you mean by ... a new worksheet with the
questionnaire should open up ..., but you can rename the sheet like so

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H10" '<=== DV cell change to suit

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
me.Name = .Value
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--
HTH

Bob Phillips

(there's no email, no snail mail, but somewhere should be gmail in my addy)

<Sadia wrote in message ...
I have created a questionnaire in excel for customer product reviews. I

want the customer to select the product they wish to review and based upon
the selection, a new worksheet with the questionnaire should open up and the
worksheet should be renamed with the product name.

Currently I have created a macro in excel which allows you to select the

product and this automatically opens a new worksheet. I am however unable to
rename the worksheet based upon the drop-down selection.

Any ideas?

Thanks a lot!

--Sadia

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com