lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi, if I close the Inputbox without entering anything, excel will give me this error message:
"Run-Time error '13" - Type mismatch". How can I improve the code so I wont get that error message when I close inputbox suddenly. Thank you so much.
+++++
Sub colorall()
Dim x As Integer
x = InputBox("enter sheet")
Workbooks(1).Worksheets(x).Range("D1:f10").Interior.ColorIndex = 11
End Sub
"Run-Time error '13" - Type mismatch". How can I improve the code so I wont get that error message when I close inputbox suddenly. Thank you so much.
+++++
Sub colorall()
Dim x As Integer
x = InputBox("enter sheet")
Workbooks(1).Worksheets(x).Range("D1:f10").Interior.ColorIndex = 11
End Sub