Hi all,
I am new to Excel and have encounter such problem:
I am trying to prompt the user for rows selection. I am not sure if the variables are set up correctly. I tried with integers but didn't work. Thank you for your help in advance!
The code goes as follow:
Sub Select_row()
Dim leftrow As Variant, rightrow As Variant
leftrow = InputBox("give me your left row")
rightrow = InputBox("Give me your right row")
Range("leftrow:rightrow").Select
End Sub
The error message goes as:
[FONT="]Run-time error '1004':[/FONT]
[FONT="]
[/FONT]
[FONT="]Method 'Range' of object '_Global' failed[/FONT]
<attachment></attachment>
I am new to Excel and have encounter such problem:
I am trying to prompt the user for rows selection. I am not sure if the variables are set up correctly. I tried with integers but didn't work. Thank you for your help in advance!
The code goes as follow:
Sub Select_row()
Dim leftrow As Variant, rightrow As Variant
leftrow = InputBox("give me your left row")
rightrow = InputBox("Give me your right row")
Range("leftrow:rightrow").Select
End Sub
The error message goes as:
[FONT="]Run-time error '1004':[/FONT]
[FONT="]
[/FONT]
[FONT="]Method 'Range' of object '_Global' failed[/FONT]
<attachment></attachment>