+ Reply to Thread
Results 1 to 3 of 3

Range Loop

  1. #1
    Registered User
    Join Date
    03-24-2006
    Posts
    15

    Range Loop

    Hi,

    I have an excel spreadsheet that contains data in a number of columns (some contain data and some do not). I would like to have a seperate spreadsheet check the range (E3:IV3), if data is present in this row, I would like the seperate spreadsheet to write these cell values to corresponding rows in this sheet. How can I approach this issue?


    example:

    testScript.xls(Summary Tab)


    A B C D E F G H I ........IV
    App # 654 765 652



    summary.xls(Findings Tab)

    App #
    654
    765
    652











    Thanks in advance for anyhelp
    Last edited by lbargers; 03-27-2006 at 07:13 PM.

  2. #2
    Tom Ogilvy
    Guest

    Re: Range Loop

    Can we conclude that if there is data in Column E, then the row should be
    copied

    Sub CopyData()
    Dim rng as Range, rng1 as Range
    Dim rng2 as Range
    With Activesheet
    set rng = .Range(.cells(3,"E"),.Cells(rows.count,"E").End(xlup))
    On error resume next
    set rng1 = rng.Specialcells(xlconstants)
    On Error goto 0
    if not rng1 is nothing then
    set rng2 = intersect(rng1.EntireRow, .Columns("E:IV"))
    rng2.copy Destination:=Worksheets("Data").Range("A1")
    end if
    End With
    End Sub

    --
    Regards,
    Tom Ogilvy


    "lbargers" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi,
    >
    > I have an excel spreadsheet that contains data in a number of columns
    > (some contain data and some do not). I would like to have a seperate
    > spreadsheet check the range (E3:IV3), if data is present in this row, I
    > would like the seperate spreadsheet to write the cell values of the
    > range to a seperate spreadsheet. How can I approach this issue?
    >
    > Thanks in advance for anyhelp
    >
    >
    > --
    > lbargers
    > ------------------------------------------------------------------------
    > lbargers's Profile:

    http://www.excelforum.com/member.php...o&userid=32798
    > View this thread: http://www.excelforum.com/showthread...hreadid=526899
    >




  3. #3
    Registered User
    Join Date
    03-24-2006
    Posts
    15
    Tom, thanks for your reply.. How can I specify the location of the seperate .xls spreadsheets in the example you provided?

+ 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