Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Rename Tab with Textbox on Worksheet

How would I rename the tab with a Text Box on a worksheet? Not a
userform

I've tried the following doesn't seem to work.

Private Sub TextBox127_LostFocus()
ActiveSheet.Name = Me.Textbox127.value
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Rename Tab with Textbox on Worksheet

most people would hit ENTER when they're done ...so use the textbox's KEYDOWN
method to check if its been pressed....


Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal
Shift As Integer)
If KeyCode = 13 Then
If TextBox1.Value < "" Then
On Error Resume Next
ActiveSheet.Name = TextBox1.Value
On Error GoTo 0
End If
End If
End Sub



"LRay67" wrote:

How would I rename the tab with a Text Box on a worksheet? Not a
userform

I've tried the following doesn't seem to work.

Private Sub TextBox127_LostFocus()
ActiveSheet.Name = Me.Textbox127.value
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Rename Tab with Textbox on Worksheet

Patrick, thanks for the info.

I am not marco/progrmamer literate, not sure what you are referring to with
the textbox's KEYDOWN method. Can you help?

This is what I have placed on the individual worksheet (code sheet)

Private Sub TextBox127_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
If KeyCode = 13 Then
If TextBox127.value < "" Then
On Error Resume Next
ActiveSheet.Name = TextBox127.value
On Error GoTo 0
End If
End If
End Sub


"Patrick Molloy" wrote:

most people would hit ENTER when they're done ...so use the textbox's KEYDOWN
method to check if its been pressed....


Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal
Shift As Integer)
If KeyCode = 13 Then
If TextBox1.Value < "" Then
On Error Resume Next
ActiveSheet.Name = TextBox1.Value
On Error GoTo 0
End If
End If
End Sub



"LRay67" wrote:

How would I rename the tab with a Text Box on a worksheet? Not a
userform

I've tried the following doesn't seem to work.

Private Sub TextBox127_LostFocus()
ActiveSheet.Name = Me.Textbox127.value
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Rename Tab with Textbox on Worksheet

looks good.

"LRay67" wrote:

Patrick, thanks for the info.

I am not marco/progrmamer literate, not sure what you are referring to with
the textbox's KEYDOWN method. Can you help?

This is what I have placed on the individual worksheet (code sheet)

Private Sub TextBox127_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
If KeyCode = 13 Then
If TextBox127.value < "" Then
On Error Resume Next
ActiveSheet.Name = TextBox127.value
On Error GoTo 0
End If
End If
End Sub


"Patrick Molloy" wrote:

most people would hit ENTER when they're done ...so use the textbox's KEYDOWN
method to check if its been pressed....


Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal
Shift As Integer)
If KeyCode = 13 Then
If TextBox1.Value < "" Then
On Error Resume Next
ActiveSheet.Name = TextBox1.Value
On Error GoTo 0
End If
End If
End Sub



"LRay67" wrote:

How would I rename the tab with a Text Box on a worksheet? Not a
userform

I've tried the following doesn't seem to work.

Private Sub TextBox127_LostFocus()
ActiveSheet.Name = Me.Textbox127.value
End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using information from one worksheet, to rename inserted worksheet Lyn Excel Worksheet Functions 0 March 24th 06 12:54 AM
Rename the worksheet praveen_khm Excel Discussion (Misc queries) 1 January 17th 06 08:05 PM
Rename Textbox on Worksheets Darren Hill[_3_] Excel Programming 16 June 18th 05 09:27 PM
Add and rename a worksheet Microsoft Forum Excel Programming 1 December 14th 04 11:28 AM
Rename worksheet Donald Duck Excel Programming 3 August 17th 04 10:15 AM


All times are GMT +1. The time now is 04:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"