lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
I have workbook which has worksheet called hello or sheet1(hello) that is how it looks like in the vba project window. The code below does not work because of
but if I changed it to
it will work! Why is that? thank you very much
I have workbook which has worksheet called hello or sheet1(hello) that is how it looks like in the vba project window. The code below does not work because of
Code:
Workbooks(1).Sheet1.Activate
Code:
workbooks(1).worksheets("hello").Activate
Code:
Sub create_ws_using_ws_collection()
Dim x As Integer
x = InputBox("for which book")
Workbooks(x).Worksheets.Add after:=Sheet1
Workbooks(1).Sheet1.Activate
End Sub