+ Reply to Thread
Results 1 to 7 of 7

Search for "copied" data

Hybrid View

  1. #1
    Registered User
    Join Date
    07-12-2009
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    49

    Talking Search for "copied" data

    This is the code I have

    Range("O48").Copy
        Sheets("Alerts vs Actual").Select
        Cells.Find(What:="x008", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
            :=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
            False, SearchFormat:=False).Activate
    Instead of looking for "x008", I need the macro to search for the copied data from cell "O48"....As it will always be a different value

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Search for "copied" data

    How would Excel know that the data is copied?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    07-12-2009
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    49

    Re: Search for "copied" data

    Quote Originally Posted by royUK View Post
    How would Excel know that the data is copied?
    "Range("O48").Copy"

    Then I just CTRL+V'd it into the search field when I was recording the macro....But that obviously doesn't work, as it doesn't record the paste method rather just the value that was input....unless I can somehow code it to paste selection in the Cells.Find(What:="selection.paste"

    Or something like that

    Alternatively if we can make it search for the contents of the current selected cell in the next worksheet that would work also.....
    Last edited by cooper1308; 11-06-2009 at 03:10 AM.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Search for "copied" data

    Are you trying to copy a value to the next empty cell?

  5. #5
    Registered User
    Join Date
    07-12-2009
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    49

    Re: Search for "copied" data

    Quote Originally Posted by royUK View Post
    Are you trying to copy a value to the next empty cell?
    Nope...

    I'm selecting a cell...

    Then offsetting by 9 columns...and copying the contents of the "trade ID" cell

    Then searching the next worksheet for that same "trade ID" and selecting that cell

    The term that I am searching for will always be relative to the initial cell I selected, and always have a different value

    I guess I don't really need to copy it.....Just search for it on the next worksheet
    Last edited by cooper1308; 11-06-2009 at 03:35 AM.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Search for "copied" data

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  7. #7
    Registered User
    Join Date
    07-12-2009
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    49

    Re: Search for "copied" data

    In the attached, please select B:48 on the "running PL" sheet

    Then run the "CloseTrades" Macro...or hit the close button

    Don't regurgitate when you see my code....it's a little messy

    But as you can see I am looking to find the unique "trade ID" that is assigned on the next sheet. Obviously there will be far more data in time
    Attached Files Attached Files

+ 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