ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Reference Tab name to two textboxes (https://www.excelbanter.com/excel-discussion-misc-queries/121293-reference-tab-name-two-textboxes.html)

AOU

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

Laus

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


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


Chip Pearson

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




JMay

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



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