most
Board Regular
- Joined
- Feb 22, 2011
- Messages
- 107
- Office Version
- 365
- 2019
- Platform
- Windows
- Mobile
Why does this not work?
According to the internet I could use Val() to convert a string to a value.
The script should activate a specific column depending on if you enter a number or a column letter.
According to the internet I could use Val() to convert a string to a value.
Code:
Sub GotoColumn() Dim x As String
x = InputBox("Goto column...")
If IsNumeric(x) = False Then x = Range(x & 1).Column
x = Val(x)
Cells(1, x).Activate
End Sub
The script should activate a specific column depending on if you enter a number or a column letter.