NewBieSteffie
asked on
How can I set the range using the users column letter input?
The user can input a column letter
How can I set the range if the user has already inputted a column letter
I have pasted my code here in which I set the range to the column letter that the user inputted up to its last row
How can I set the range if the user has already inputted a column letter
I have pasted my code here in which I set the range to the column letter that the user inputted up to its last row
Dim IntColumn
ColumnLetter = Application.InputBox(prompt:="Enter Column Letter ", Type:=2)
With ActiveSheet
LastRow = .Cells.Find("*", , xlValues, xlWhole, xlByRows, xlPrevious, False).Row
End With
Set IntColumn = Range("ColumnLetter:LastRow")
ASKER
I got a run time error 1004
What should I do?
What should I do?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
When you have separate Column and Row variables, I generally find it easier to use and understand if I use the Cells method...
Note that ColumnIndex accepts either numbers or string (text) representations.
Set IntColumn = Cells(RowIndex:=LastRow, ColumnIndex:=ColumnLetter)
Note that ColumnIndex accepts either numbers or string (text) representations.
ASKER
This works !!!
Thanks
Thanks
ASKER
@Ryan Chong Thank you!
@Wayne Taylor (webtubbs)
Your code works as well thank you
@Wayne Taylor (webtubbs)
Your code works as well thank you
Open in new window