View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
JMay JMay is offline
external usenet poster
 
Posts: 422
Default Reference Tab name to two textboxes

I interpret OP to Want Text box Names combined;
So (using your code)

Private Sub TextBox1_LostFocus()
On Error Resume Next
ActiveSheet.Name = Me.TextBox1.Text & Me.TextBox2.Text
End Sub


Private Sub TextBox2_LostFocus()
On Error Resume Next
ActiveSheet.Name = Me.TextBox1.Text & Me.TextBox2.Text
End Sub




"Chip Pearson" wrote in message
:

Try code like

Private Sub TextBox1_LostFocus()
On Error Resume Next
ThisWorkbook.Worksheets(1).Name = Me.TextBox1.Text
End Sub


Private Sub TextBox2_LostFocus()
On Error Resume Next
ThisWorkbook.Worksheets(2).Name = Me.TextBox2.Text
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"AOU" wrote in message
...
I have a workbook with several worksheets and want each tab to reflect what
is in
Textbox1 and Textbox2 of the respective worksheet.
Textbox1 contains surnames and Textbox2 contains first name.
--
AOU