+ Reply to Thread
Results 1 to 9 of 9

Copy cell value and paste into filter macro

  1. #1
    Registered User
    Join Date
    10-13-2008
    Location
    Australia
    MS-Off Ver
    2007
    Posts
    85

    Copy cell value and paste into filter macro

    Hi All,

    I am trying to see what items are being stored in a container by selecting the container number on another sheet.

    Sheet 1 contains the container number (B).
    Sheet 2 contains the item code (A) and the container number (F).

    At the moment, the macro I have is:

    Please Login or Register  to view this content.
    What I want to achieve is:
    1) Select the cell(Sheet1) which has the container no. I want to filter in Sheet2.
    2) Run the macro which will go to sheet 2, filter by Equal To, paste, OK.

    This would be great however the macro is not recording this as a paste but as the text I originally did the macro with "APHU".
    So in theory I want to do the below but this doesn't work.

    Please Login or Register  to view this content.
    If you need any further clarification please let me know.

    Thanks for your help

    Benno
    Last edited by rylo; 11-04-2008 at 11:44 PM. Reason: added code tags

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Why don't you use the advanced filter which allow you to specify a criteria range and you can then set the container code and the item number.....

    rylo

  3. #3
    Registered User
    Join Date
    10-13-2008
    Location
    Australia
    MS-Off Ver
    2007
    Posts
    85
    Hi,

    I can get the result I want by doing using auto filter, which would be simpler than using the advanced filter but I am after a way that would act like a hyperlink that automatically filters the rows. So I came to the conclusion a macro would be easiest but it isn't quite working how I want it to, So I want to be able to do all this in a macro, so there is as little repetitive process as possible.

    I appreciate your help but do you have any other suggestions?

    Benno

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Where in sheet1 is the value you want to filter by? In a consistent place and if so where?

    rylo

  5. #5
    Registered User
    Join Date
    10-13-2008
    Location
    Australia
    MS-Off Ver
    2007
    Posts
    85
    The values I want to filter by are in Sheet1 column B only.

    I then want to use these values to filter Sheet2 column F.

    Have you got an idea?

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    So you have a list of values in column B, and you want to filter by each of these values in turn? What do you want to do with the results of the filter?

    Perhaps you should build an example file and attach to the post so we can see what you are working with....


    rylo

  7. #7
    Registered User
    Join Date
    10-13-2008
    Location
    Australia
    MS-Off Ver
    2007
    Posts
    85
    Hi,

    I have attached a very basic format of what I want.

    I want to be able to click (or run a macro) on a container number (Sheet1) and be redirected to Sheet2 where a filter has been done for that container number.

    EG If I clicked on MSCU in Sheet1, I want it to show what I have done in Sheet3 (as an example) but in Sheet2.

    As a hyperlink does not do this, I created a macro (see my first post). By using the macro, I would select the container number I wanted to filter Sheet2 by, then run the macro which copies and pastes but it does not register this as a paste but what text it is recorded with.

    I hope I'm not confusing you any more than I already have.

    Thanks for your help thus far.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    In a general module in your example file, add the code

    Please Login or Register  to view this content.
    Now go to sheet1, select cell A6 and run the code.

    Go to sheet2 to see the output.

    HTH

    rylo

  9. #9
    Registered User
    Join Date
    10-13-2008
    Location
    Australia
    MS-Off Ver
    2007
    Posts
    85
    THANK YOU VERY MUCH!!!

    This is great, I've modified it a bit to select Sheet2 and the cell A1 so i can see it all at the click of a button, without having to scroll up. But this is excellent!! I appreciate your help and patience.

    Thanks again

+ 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