View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default Textbox value - rename worksheet with

Dim wsName As String
Dim WS_Count As Integer
Dim i As Integer
WS_Count = ActiveWorkbook.Worksheets.Count
' Begin the loop.
For i = 1 To WS_Count
wsName = Textbox1.value & i
On Error Resume Next
ActiveWorkbook.Worksheets(i).Name = & wsName
Next i

"LRay67" wrote:

I have 10 tabs that I will need to rename from a textbox (not the range in
the code below). The following code has to be ran first, then backtrack to
rename the appropriate tabs to the value in the textbox. Anyone have any
ideas?

Range("P5:R5").Copy
For sh = 2 To Sheets.Count
If Sheets(sh).Name Like ("Request*") Then
ActiveSheet.Paste Destination:=Sheets(sh).Range("P5:R5")
End If
Next
End Sub