+ Reply to Thread
Results 1 to 15 of 15

Macro to filter one column and move that data into another.

  1. #1
    Registered User
    Join Date
    08-07-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    39

    Macro to filter one column and move that data into another.

    Hi All

    Apologies if this has been answered before, I have searched for some time, but am finding it difficult to adapt any solutions to my needs...

    I have data in column Q, and want to filter that by non-blanks then copy all entries into Column J. (Using a VLOOKUP referencing to column A, or open to suggestions).

    I would also like to put this lookup/formula in the code rather than paste from a cell.

    Any help would be greatly appreciated
    Last edited by Dgp2012; 06-01-2013 at 03:57 AM.

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Macro to filter one column and move that data into another.

    Dgp2012,

    Welcome to the Excel Forum.

    We could use an array in memory (very fast) that could do the work for you.

    If interested, then please attach your workbook.


    To get the most precise answer, it is best to upload/attach a sample workbook (sensitive data scrubbed/removed/changed) that contains an example of your raw data on one worksheet, and on another worksheet your desired results.

    The structure and data types of the sample workbook must exactly duplicate the real workbook. Include a clear and explicit explanation of your requirements.

    To attach your workbook, scroll down and click on the Go Advanced button, then scroll down and click on the Manage Attachments button.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Registered User
    Join Date
    08-07-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Macro to filter one column and move that data into another.

    Thanks for your welcome, and response.

    I have (hopefully) attached my sample worksheet and in the second tab simply displayed how it should look after the code has run...
    Attached Files Attached Files
    Last edited by Dgp2012; 05-30-2013 at 08:38 AM.

  4. #4
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Macro to filter one column and move that data into another.

    Dgp2012,

    The Result worksheet is only showing what the changes should be made in the Sample worksheet?

    What is the actual worksheet name for the Sample worksheet?

  5. #5
    Registered User
    Join Date
    08-07-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Macro to filter one column and move that data into another.

    "Price Tracker"..

  6. #6
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro to filter one column and move that data into another.

    may be
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    08-07-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Macro to filter one column and move that data into another.

    Thanks for the response, but it hasn't quite worked

    I think the "Q3" part is the problem but not sure what to change it to...

  8. #8
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro to filter one column and move that data into another.

    Try again. Change the values ​​in the column Q and press the green button.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    08-07-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Macro to filter one column and move that data into another.

    Thank you!!

    The only slight problem when I transferred the data in the actual workbook it carried over the blanks. I thought this was due to formula being in there so removed the formula but it continued to carry over the blanks; is there a slight change I need to make?

    Thanks again for your help!!

  10. #10
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro to filter one column and move that data into another.

    maybe so
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    08-07-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Macro to filter one column and move that data into another.

    The .replace is looking for a workbook?

  12. #12
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro to filter one column and move that data into another.

    Dgp2012,
    probably it would be better if you show a small example with your real data

  13. #13
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Macro to filter one column and move that data into another.

    Dgp2012,

    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    Please Login or Register  to view this content.
    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then run the AdjustPrice macro.

  14. #14
    Registered User
    Join Date
    08-07-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Macro to filter one column and move that data into another.

    This has worked perfectly!

    Thank you both for your time, this has helped very much

  15. #15
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Macro to filter one column and move that data into another.

    Dgp2012,

    Thanks for the feedback.

    You are very welcome. Glad we could help.

    And, come back anytime.

+ 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