View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default VBA Assistance Needed

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10"
Dim oWS As Worksheet
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
On Error Resume Next
Set oWS = Worksheets(.Value)
If oWS Is Nothing Then Worksheets.Add.Name = .Value
On Error GoTo 0
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

(remove nothere from email address if mailing direct)

"RalphB" wrote in message
...
I need help writing code that will allow me to enter a name into a list on
Sheet1 that will triger a macro on Sheet2 that will use the name entered

on
Sheet1.

The name is for a supplier and the macro would generate a new sheet
providing the supplier's information and carying the suppliers name on the
page tab.

I am using XP Pro and Excel 2003.