Reference Tab name to two textboxes

A

AOU

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.
 
L

Laus

Double click on the tab and name it as you wish. Or, right click on the tab
and click rename. Hope this helps.
 
A

AOU

Thanks for the reply. But I was after the sheet Tab displaying the contents
of two textboxes. I that possible
 
C

Chip Pearson

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)
 
J

JMay

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
 
Top