![]() |
Reference Tab name to two textboxes
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 |
Reference Tab name to two textboxes
Double click on the tab and name it as you wish. Or, right click on the tab
and click rename. Hope this helps. "AOU" wrote: 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 |
Reference Tab name to two textboxes
Thanks for the reply. But I was after the sheet Tab displaying the contents
of two textboxes. I that possible -- AOU "Laus" wrote: Double click on the tab and name it as you wish. Or, right click on the tab and click rename. Hope this helps. "AOU" wrote: 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 |
Reference Tab name to two textboxes
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 |
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 |
Reference Tab name to two textboxes
Thank you all, very helpfull.
-- AOU "JMay" wrote: 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 |
All times are GMT +1. The time now is 01:20 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com