+ Reply to Thread
Results 1 to 2 of 2

Selection Data from a Range

  1. #1
    Mr M Walker
    Guest

    Selection Data from a Range

    I am trying to select data from a range of data using an If STATEMENTS, is
    this possible please see below:

    I am trying to return 10 columns of data if a uique number is found in a
    spreasheet for example

    005
    006
    007
    008

    if sheets1.cells(r,1) = "007" then
    sheets2.cells(r,1) = sheets1.cells(r,1)
    sheets2.cells(r,2) = sheets1.cells(r,2)
    sheets2.cells(r,3) = sheets1.cells(r,3)
    End if




  2. #2
    Tom Ogilvy
    Guest

    Re: Selection Data from a Range

    possibly try this modification:

    if sheets1.cells(r,1).Text = "007" then
    sheets2.Cells(r,1).Resize(1,10).Value = _
    sheets1.Cells(r,1).Resize(1,10).Value
    end if

    Note that the Sheets2 and Sheets1 is usually Sheet2 and Sheet1 unless you
    changed them in the VBE.

    --
    Regards,
    Tom Ogilvy


    "Mr M Walker" <[email protected]> wrote in message
    news:[email protected]...
    > I am trying to select data from a range of data using an If STATEMENTS, is
    > this possible please see below:
    >
    > I am trying to return 10 columns of data if a uique number is found in a
    > spreasheet for example
    >
    > 005
    > 006
    > 007
    > 008
    >
    > if sheets1.cells(r,1) = "007" then
    > sheets2.cells(r,1) = sheets1.cells(r,1)
    > sheets2.cells(r,2) = sheets1.cells(r,2)
    > sheets2.cells(r,3) = sheets1.cells(r,3)
    > End if
    >
    >
    >




+ 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