Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
selecting a variable row range
I have the following code working to select my fixed
source and destination ranges. How do I change my fixed sourceRange to a variable sourceRange. Currently the sourceRange is fixed .Range(K3:M3), this is date data, but I could have 1 date in K3 only or dates from K3 to IV3. How do I select this variable range? Dim sourceRange As Range, destRange As Range Dim Lr As Long Lr= LastRow(Sheets("S1"))+1 Set sourceRange = Sheets("S1").Range("K3:M3") I already setup my LastRow and LastColumn FUNCTIONs to support Lr. Thanks goes to Ron de Bruin and his website for coding help. Thanks for the help. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
selecting a variable row range
See my reply to your other post
"Dan" wrote: I have the following code working to select my fixed source and destination ranges. How do I change my fixed sourceRange to a variable sourceRange. Currently the sourceRange is fixed .Range(K3:M3), this is date data, but I could have 1 date in K3 only or dates from K3 to IV3. How do I select this variable range? Dim sourceRange As Range, destRange As Range Dim Lr As Long Lr= LastRow(Sheets("S1"))+1 Set sourceRange = Sheets("S1").Range("K3:M3") I already setup my LastRow and LastColumn FUNCTIONs to support Lr. Thanks goes to Ron de Bruin and his website for coding help. Thanks for the help. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
selecting a variable row range
Set sourceRange = Sheets("S1").Range(Range("K3"),Cells(LastRow,LastC ol)) -- HTH RP (remove nothere from the email address if mailing direct) "Dan" wrote in message ... I have the following code working to select my fixed source and destination ranges. How do I change my fixed sourceRange to a variable sourceRange. Currently the sourceRange is fixed .Range(K3:M3), this is date data, but I could have 1 date in K3 only or dates from K3 to IV3. How do I select this variable range? Dim sourceRange As Range, destRange As Range Dim Lr As Long Lr= LastRow(Sheets("S1"))+1 Set sourceRange = Sheets("S1").Range("K3:M3") I already setup my LastRow and LastColumn FUNCTIONs to support Lr. Thanks goes to Ron de Bruin and his website for coding help. Thanks for the help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selecting a variable range | Excel Programming | |||
Selecting a variable range | Excel Programming | |||
Selecting a variable Range | Excel Programming | |||
Selecting Variable Row Range w/Macro | Excel Programming | |||
Selecting a Range Using a Variable | Excel Programming |