selecting a variable row range

D

Dan

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.
 
B

Bob Phillips

Set sourceRange = Sheets("S1").Range(Range("K3"),Cells(LastRow,LastCol))

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top