+ Reply to Thread
Results 1 to 22 of 22

Matching Macro, Matching Dr. to Cr.

  1. #1
    Registered User
    Join Date
    12-12-2012
    Location
    delhi
    MS-Off Ver
    Excel 2010
    Posts
    26

    Matching Macro, Matching Dr. to Cr.

    Hey guys ,
    Need Help creating a Macros on Excel
    One colum i have amounts and the other colum had debits or credits.

    What i want is when i run the macro same amounts to be highlighted eg 100 dr gets highlighted and 100 credit

    Attaching a file for reffrence

    Please help

    THXBook1.xlsx

  2. #2
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    818

    Re: Matching Macro, Matching Dr. to Cr.

    Try it once.
    Suppose "Debit" number rather than "Credit".
    Please Login or Register  to view this content.
    Kind regards, Harry.

  3. #3
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Matching Macro, Matching Dr. to Cr.

    Hi -

    First of all, glad you managed to post your own thread.
    Try whatever comes first debit or credit
    Please Login or Register  to view this content.
    Regards,
    Event

  4. #4
    Registered User
    Join Date
    12-12-2012
    Location
    delhi
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Matching Macro, Matching Dr. to Cr.

    Guys u are the best

    Thank You so much , u guys are so awsome ..:p

    Thank You

    btw i dint select any thing just inserted module and past it there and run it...
    And it worked
    thx again guys

  5. #5
    Registered User
    Join Date
    12-12-2012
    Location
    delhi
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Matching Macro, Matching Dr. to Cr.

    one more question:

    on my actual sheets the amount and debit credit colum are in between ....so before running this do i need to select any thing ???

    and wats the diff between the two coding which u guys have posted are the both same ?

    Thx

  6. #6
    Registered User
    Join Date
    12-12-2012
    Location
    delhi
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Matching Macro, Matching Dr. to Cr.

    guys one more thing is required , i need ur help for that.

    Tha macro is fine, I want one more thing added to it.
    Third colum would have account no . I want the dr to match cr only if the account number is same.

    Colum name would be "Original Description" .Book1 (4).xlsx


    Thanks

  7. #7
    Registered User
    Join Date
    12-12-2012
    Location
    delhi
    MS-Off Ver
    Excel 2010
    Posts
    26

    Macro Matching Dr to Cr,

    Guys, I want
    I want that Cr 100 to match to dr 100 only if the acc number is the same.


    Third colum would have account no . I want the dr to match cr only if the account number is same.

    Colum name would be "Original Description" .Book1 (4).xlsx

    Attaching the file for ref tBook1 (4).xlsxhanks


    Thanks

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro Matching Dr to Cr,

    Hi,

    Is this what you wanted, is it even what you requested??

    Please Login or Register  to view this content.
    Directions for running the routine(s) just supplied

    Copy the code to the clipboard

    Press ALT + F11 to open the Visual Basic Editor.

    Open a macro-enabled Workbook or save your Workbook As Macro-Enabled

    Select “Module” from the Insert menu

    Type "Option Explicit" then paste the code into the white space on the right

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  9. #9
    Registered User
    Join Date
    12-12-2012
    Location
    delhi
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Macro Matching Dr to Cr,

    Book1 (4).xlsmHey i tried running it .
    I pressed F11 , VB opened i inserted the module and paste the code and pressed f11 to close it then f8 to run the macro . It took me back to the coding and one line got highlighted in yellow.

    Iam attaching the file for reffrence , please see it once youll understand. Thanks for helping out . Appreciate it.

    Thanks

  10. #10
    Registered User
    Join Date
    12-12-2012
    Location
    delhi
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Matching Macro, Matching Dr. to Cr.

    Guys please.

    Thanks

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro Matching Dr to Cr,

    F8 is for single stepping - if you want to just run the routine , hit F5!

  12. #12
    Registered User
    Join Date
    12-12-2012
    Location
    delhi
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Matching Macro, Matching Dr. to Cr.

    Thanks alot brother. Really appreciate your help


  13. #13
    Registered User
    Join Date
    12-12-2012
    Location
    delhi
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Matching Macro, Matching Dr. to Cr.

    Book1 ().xlsx

    Dude ,
    I entered two amount '77.24' one debit one credit. with same account number. It din't turn green (it should have matched)

    Attaching the file . Please check the last two amounts . Sorry for the trouble.

    Thanks

  14. #14
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Matching Macro, Matching Dr. to Cr.

    You're welcome, for the new values just change the Amt declaration(in red):

    Please Login or Register  to view this content.
    Thanks for the rep!

  15. #15
    Registered User
    Join Date
    12-12-2012
    Location
    delhi
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Matching Macro, Matching Dr. to Cr.

    Thanks Buddy you'r the best

  16. #16
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Matching Macro, Matching Dr. to Cr.

    You're welcome!

  17. #17
    Registered User
    Join Date
    12-12-2012
    Location
    delhi
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Matching Macro, Matching Dr. to Cr.

    Bro please help

    Acct = Range("C" & i):

    Is turning yellow .

  18. #18
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Matching Macro, Matching Dr. to Cr.

    Try single stepping (F8) and see if the value of i is legitimate. Or, post a sample of the book which has this problem.

  19. #19
    Registered User
    Join Date
    12-12-2012
    Location
    delhi
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Matching Macro, Matching Dr. to Cr.

    match Macro.xlsm

    file attached.

    One more thing i want that the matched entry cell should turn green instead of the font. Its a little easier to spot.

    Thanks

  20. #20
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Matching Macro, Matching Dr. to Cr.

    Well, that really isn't an Account Number - but this should work, I used a lighter Green:

    Please Login or Register  to view this content.

  21. #21
    Registered User
    Join Date
    12-12-2012
    Location
    delhi
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Matching Macro, Matching Dr. to Cr.

    Dude thanks alot for all the help.

    Really appreciate it.

    If you don't mind can u share your email address, if i have any problems i can contact u directly.
    Thanks again

  22. #22
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Matching Macro, Matching Dr. to Cr.

    You're welcome.
    Last edited by arlu1201; 07-01-2013 at 01:51 AM. Reason: Removed email id to avoid spam.

+ 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