+ Reply to Thread
Results 1 to 3 of 3

[SOLVED]Help with VBA Macro - Returning Entire Row

  1. #1
    Registered User
    Join Date
    02-04-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    25

    [SOLVED]Help with VBA Macro - Returning Entire Row

    Wats up,

    I'm trying to return an entire row of data based on the values in one column.

    Attached is what I have so far. This is all being done via Button 1.

    User is to input a min and max value, which is then searched in Column E. If it is found, the row is to be returned in addition to the adjacent row, which is located above or below it. One row has the date in Column A, and the other row has the time in Column A.

    The below code was given to me by jaslake, but currently all it does is put an asterisk next to the two rows.
    Please Login or Register  to view this content.
    The code actually checks to see if the row has a DATE or TIME in column A. The DATE is always in the first row and the TIME is always in the 2nd row. Based on Column A (After column E is searched), it determines which is the adjacent row.

    Now I just need the data for both rows to be extracted to Sheet 2, each value receiving its own column.

    Ex:
    A B C D
    2-6 Wed 3:00 2a 8
    2-6 Wed 3:00 2b 9

    *Adjacent rows share the same date and time.

    Thanks for reading and for the help if possible.
    Attached Files Attached Files
    Last edited by BamBamMoneyBags; 02-08-2013 at 12:36 AM.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Help with VBA Macro - Returning Entire Row

    Hi BamBam,

    Try this:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Help with VBA Macro - Returning Entire Row

    Hello BamBamMoneyBags,

    This revision of the macro will copy the rows to "Sheet2" column "A:D". The macro has been added to the attached workbook.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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