lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
the code below is working. However if I do not put white space between x and i in line 6
I would get "expect end of statement" error message. Why white space in important here? Thanks a lot.
the code below is working. However if I do not put white space between x and i in line 6
I would get "expect end of statement" error message. Why white space in important here? Thanks a lot.
Rich (BB code):
Sub ws_name()
Dim x As String
Dim i As Integer
x = InputBox("enter name")
For i = 1 To Workbooks(2).Worksheets.Count
Workbooks(2).Worksheets(i).Name = x & i
Next i
End Sub