+ Reply to Thread
Results 1 to 10 of 10

Need a Macro to pull data from one cell and place into another one time

  1. #1
    Registered User
    Join Date
    10-02-2012
    Location
    phoenix
    MS-Off Ver
    Excel 2007
    Posts
    31

    Need a Macro to pull data from one cell and place into another one time

    My Macro abilities are very limited and outdated, so I am reaching out to the group for some guidance on what I want to do. See the attached png files for a couple screenshots.
    database 1.png database 2.png

    I have a summary tab and I want a cell to return the number in a cell (which there may be several with same number) on another tab. I want only one result for the first cell on my summary sheet, and I want the next cell down to return the next numerical number based on previous cell pulled from other tab.

    EXAMPLE:

    Summary tab - Cell B8 is empty but i want it to pull the first number in numerical order from the Data tab "E" Column.

    Data tab - "E" Column will have a number in it like 1-1-01 (3-22 times) and so on and so on. There will be ones like 3-1-06, so I want the summary sheet to pull only one of those numbers and place it in a numerical fashion on summary sheet.

    so numbers in column B8 will look something like this

    1-1-01
    1-1-02
    1-2-01
    2-3-01

    Numbers are pulled from the Data tab that looks something like this

    1-1-01
    1-1-01
    2-3-01
    2-3-01
    1-1-01
    1-1-02
    1-1-02
    1-1-02
    1-1-02
    1-2-01
    1-2-01
    2-3-01
    1-1-01

    I hope I made some sense.

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Need a Macro to pull data from one cell and place into another one time

    Hi jgregory43,
    Can you try this code... you might need to change the tab names.

    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,641

    Re: Need a Macro to pull data from one cell and place into another one time

    Do you have something like 11-11-01, 1-12-02 etc.

    If so, it is not so simple.

    And No idea why the index starts from 1 in code posted above.....
    For i = 1 To .Count - 1
    Try this
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Need a Macro to pull data from one cell and place into another one time

    Jindon is correct is you have something like 11-11-01, 1-12-02 etc.
    However, there seems to be a small error in one line of the code :

    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,641

    Re: Need a Macro to pull data from one cell and place into another one time

    Actually, you should consider the data which doesn't meet the pattern, such like only non numeric characters only.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-02-2012
    Location
    phoenix
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Need a Macro to pull data from one cell and place into another one time

    For what I needed, the first code worked perfectly, and I tried it with doing double digits in the information I wanted to pull, and still worked like I wanted.
    The only issue I had was if I were to remove one of the numbers pulled from Room Data sheet, it wont remove it from the Summary sheet and move the other numbers up.
    How do I make it remove that one and resort?

  7. #7
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Need a Macro to pull data from one cell and place into another one time

    If you run the macro again, the list should be updated correctly.
    Note : clear the list first (from B8 to B???)

  8. #8
    Registered User
    Join Date
    10-02-2012
    Location
    phoenix
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Need a Macro to pull data from one cell and place into another one time

    the first code does not clear the cell

  9. #9
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Need a Macro to pull data from one cell and place into another one time

    This should work :
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    10-02-2012
    Location
    phoenix
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Need a Macro to pull data from one cell and place into another one time

    that macro cleared out my formatting of those cells as well. I just need to remove the numbers that were placed there

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Pull data from the same cell across multiple csv files and place into a single excel file
    By rbmrrbmr in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-18-2013, 10:53 AM
  2. [SOLVED] Macro to pull imported data from sheet2 and place data in specific rows on sheet1
    By PatRiot199 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-05-2013, 04:22 PM
  3. Automatically place date and time in one cell when another cell has any data entered.
    By sameredith in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-20-2012, 07:49 PM
  4. Assign macro to paste data in a different place each time
    By Pedro's PhD in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-03-2011, 01:16 PM
  5. Macro to pull specific data out and place in a seperate worksheet
    By dandavis1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-21-2008, 04:02 AM

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