Appropriate way to designate range of user input or string
I have code that asks the user to input two columns, I want to establish range as the cells in a specific column. Here is the part of my code that I'm working on and for some reason the whole code won't run when I have it like this. What am I doing wrong?
Dim ColumnOne As String
ColumnOne = InputBox("Enter the first column you're using, must be 1 digit letter. Example 'X'.")
Dim CabSheet As Worksheet
Set CabSheet = ActiveSheet
Dim rng As Range
Dim r As Range
Dim lr As Integer
lr = CabSheet.Range("G1000").End(xlUp).Row
Set rng = CabSheet.Range("ColumnOne5:ColumnOne" & lr)
If I put rng as something like Set rng = CabSheet.Range("X5:X" & lr) then it works. I can't quite figure it out.
Posted Jul 16, 2017, 10:00 PM UTC
37