+ Reply to Thread
Results 1 to 3 of 3

selecting a variable row range

  1. #1
    Dan
    Guest

    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. #2
    gocush
    Guest

    RE: 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. #3
    Bob Phillips
    Guest

    Re: selecting a variable row range


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

    --

    HTH

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


    "Dan" <[email protected]> wrote in message
    news:[email protected]...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1