+ Reply to Thread
Results 1 to 3 of 3

Macro to search based on creteria cut and paste

  1. #1
    kish_gv
    Guest

    Unhappy Macro to search based on creteria cut and paste

    Please give me solution for this problem, In my excel sheet there are four columns with Cheque No(A1). Cheque Date(B1), Amout(C1) and clearing date(D1).
    I want a macro which takes cheque no. that i give and searches that in A1column and after found that cheque cuts the Amount of that Cheque from (c1) Column and pastes it in Clearing Date column(D1) of the respective row

  2. #2
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    hi,

    This is not a solution but is guidance on how to solve your own problem...
    (People may be more willing to help when they see you've made a start.)

    The best way to start solving this is to record a macro of your actions & then look at & modify the resulting code.

    To record a macro press [alt + t + m + r], enter a name with no spaces (eg CopyAndPasteMacro), press [okay], complete the actions you've outlined, and stop the macro recorder by pressing [alt + t + m + r] again (or pressing the Stop button on the small toolbar which may have popped up when you started recording).

    Press [alt + F8] in Excel, select the macro you've created and press [Edit], & this will show the recorded code in the VB Editor.

    With this base code, the job's half done & you can ask questions about any specific problems (eg what happens if the cheque # is not found/how to change the cheque # etc).


    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  3. #3
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    hi Kish,

    Hopefully you've been able to work out a solution but just in case you haven't I thought you may appreciate some help (instead of my bluntness yesterday, sorry about that) - please see below for a macro which should do what you've asked. Test it on a copy of your data & if something doesn't look right let me know & I'll see if I can fix it for you...

    Please Login or Register  to view this content.
    This macro has some error checking in it but it doesn't check for the same cheque number appearing on 2 lines or to see if anything is already in column D - hopefully that wouldn't happen...

    hth
    Rob

+ 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