View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
cass calculator cass calculator is offline
external usenet poster
 
Posts: 42
Default problem selecting a range using variables

I'm trying to select a range with the use of variables rather than hard
inputs. I am getting an error that says "expected list seperator" when
I type the last line of code. Can you guys tell me why this code
doesnt work?

Private Sub stringtest()
Dim col_1 As Long
Dim col_2 As Long
Dim row_1 As String
Dim row_2 As String

col_1 = 1
col_2 = 2
row_1 = A
row_2 = B

Range(col_1&row_1&":"&col_2&row_2&).Select

End Sub