shane_aldrich
Board Regular
- Joined
- Oct 23, 2009
- Messages
- 148
Hi All,
THis is more of a syntax question. If you look at the string below, when I try to SET rng1 is where I'm havning trouble, If I set using the column letter, that works just fine, I'd like to know the syntax on how to set the same range, but using column numbers, next to rng1 is a comment that select A:O, just not sure how to add the others?....Thank you!!!
Sub Summary_Disconnect()
'*************************
'*** Declare Variables ***
'*************************
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Dim lLastRow As Long
Dim lLastCol As Long
Dim rng1 As Range
Dim rng2 As Range
'*********************
'*** Set Variables ***
'*********************
Set ws1 = Sheets("Disconnect_Compile")
ws1.Copy After:=Sheets(Sheets.Count)
ActiveSheet.Name = "Summary_Disconnect"
Set ws2 = Sheets("Summary_Disconnect")
lLastRow = Last(1, Columns(1))
lLastCol = Last(2, Rows(1))
Set rng1 = ws2.Range("A:O,Q:R,U:AA,AI:AN,AU:AU") ' Set rng1 = ws2.Range(ws1.Columns(1), ws2.Columns(14))
Set rng2 = Range(Cells(4, 2), Cells(lLastRow, 2))
THis is more of a syntax question. If you look at the string below, when I try to SET rng1 is where I'm havning trouble, If I set using the column letter, that works just fine, I'd like to know the syntax on how to set the same range, but using column numbers, next to rng1 is a comment that select A:O, just not sure how to add the others?....Thank you!!!
Sub Summary_Disconnect()
'*************************
'*** Declare Variables ***
'*************************
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Dim lLastRow As Long
Dim lLastCol As Long
Dim rng1 As Range
Dim rng2 As Range
'*********************
'*** Set Variables ***
'*********************
Set ws1 = Sheets("Disconnect_Compile")
ws1.Copy After:=Sheets(Sheets.Count)
ActiveSheet.Name = "Summary_Disconnect"
Set ws2 = Sheets("Summary_Disconnect")
lLastRow = Last(1, Columns(1))
lLastCol = Last(2, Rows(1))
Set rng1 = ws2.Range("A:O,Q:R,U:AA,AI:AN,AU:AU") ' Set rng1 = ws2.Range(ws1.Columns(1), ws2.Columns(14))
Set rng2 = Range(Cells(4, 2), Cells(lLastRow, 2))