+ Reply to Thread
Results 1 to 18 of 18

Condition Matches then clear the data ELSE put the remark in series by vba

  1. #1
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Condition Matches then clear the data ELSE put the remark in series by vba

    Hi Experts,
    I am looking for a macro that will do the things mentioned below

    there are 2 files 1.xls & macro.xlsm (macro will be placed in macro.xlsm),both files are loacted in diffrent places so the path will be hardcoded in the macro so that i can change it as per my needs
    sheet name can be anything
    plz see the sample file


    Condition:
    If column D of 1.xls equal to column E of 1.xls & column H of 1.xls is lower than column K then match column I of 1.xls with column B of macro.xlsm & if it matches then clear the data in that row ELSE put the remark

    If column D of 1.xls equal to column F of 1.xls & column H of 1.xls is greater than column K then match column I of 1.xls with column B of macro.xlsm & if it matches then clear the data in that row ELSE put the remark
    Attached Files Attached Files
    Last edited by dumdumbum; 07-20-2020 at 02:35 AM.

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Condition Matches then clear the data ELSE put the remark in series by vba

    Possibly...
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Condition Matches then clear the data ELSE put the remark in series by vba

    Please Login or Register  to view this content.
    Thnx Dangelor Sir for Helping me in solving this problem But
    Dangelor Sir plz run the macro on the sample file and see this macro is not giving proper output
    in the sample file i have also mentioned output sheet plz see sir

  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Condition Matches then clear the data ELSE put the remark in series by vba

    Is this what you're wanting?
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Condition Matches then clear the data ELSE put the remark in series by vba

    The macro is doing perfect in clearing the data but it has issue with the remark part (remark will be in series plz see sample file)
    I have putted some details in sample file plz see & also i have mentioned some details also
    Attached Files Attached Files

  6. #6
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Condition Matches then clear the data ELSE put the remark in series by vba

    The last 2 entries each fail one of the tests, so no remark is added or deleted.

  7. #7
    Spammer
    Join Date
    06-09-2014
    Location
    https://t.me/pump_upp
    MS-Off Ver
    Microst Office 365 Plus
    Posts
    149

    Re: Condition Matches then clear the data ELSE put the remark in series by vba

    sorry by mistakely posted the details

  8. #8
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Condition Matches then clear the data ELSE put the remark in series by vba

    Please Login or Register  to view this content.
    I am using this macro & i made some changes in sheet name & path plz see & after runing the macro it is not giving correct output Dangelor Sir
    So plz have a relook Sir

  9. #9
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Condition Matches then clear the data ELSE put the remark in series by vba

    Again, the last 2 entries fail one or the other test, so no changes occur to either HDFCBANK
    or HEROMOTOCO

  10. #10
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Condition Matches then clear the data ELSE put the remark in series by vba

    No dangelor Sir plz see the output sheet that is the result of the macro
    It is clearing all the data in that entire row
    we dont have to delete all, we have to delte the data after column B
    plz see the output sheet & how if the condition met then i have increased that by data in series plz see

  11. #11
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Condition Matches then clear the data ELSE put the remark in series by vba

    My apologies for not making myself clear...

    Using your files and the code in post #4 will give you these results.
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Condition Matches then clear the data ELSE put the remark in series by vba

    Plz see both the files
    & plz see the yellow highlighted colour in both the sheets & see if condition not met then how i putted the remarks in series

    & also see the calculation which i made
    Attached Files Attached Files

  13. #13
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Condition Matches then clear the data ELSE put the remark in series by vba

    According to the logic in your #1 post, to modify any entry, it must pass two logic tests first and only then will it either be deleted or remarked. The HDFCBANK and HEROMOTOCO entries fail one of the first two tests, and therefore the third test is not run.

    If I have misunderstood your logic, my apologies, but as written, I see no other way to interpret it.

  14. #14
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Condition Matches then clear the data ELSE put the remark in series by vba

    If the first two test has been passed then clear the data & if they are not passed then remark

    Macro clears the data if it is passed
    But if it fails then remark is needed & the given macro doesn't put remarks

    Plz run the macro Dangelor Sir & See

  15. #15
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Condition Matches then clear the data ELSE put the remark in series by vba

    So, eliminate the third test?

    Please Login or Register  to view this content.
    Last edited by dangelor; 07-23-2020 at 08:24 AM. Reason: added code

  16. #16
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Condition Matches then clear the data ELSE put the remark in series by vba

    Thnx Alot Dangelor Sir for helping me in solving this problem Sir
    Problem Solved
    Have a Awesome Day Sir

  17. #17
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Condition Matches then clear the data ELSE put the remark in series by vba

    You are welcome!

  18. #18
    Forum Contributor
    Join Date
    05-10-2020
    Location
    india
    MS-Off Ver
    2013
    Posts
    221

    Re: Condition Matches then clear the data ELSE put the remark in series by vba

    This macro has some issues
    plz see the i have attached the sample file along with the macro Dangelor Sir
    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)

Similar Threads

  1. [SOLVED] Clear the data by vba if matches
    By dumdumbum in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2020, 12:29 PM
  2. [SOLVED] copy paste the data if condition matches with dragging macro
    By dumdumbum in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-03-2020, 02:00 AM
  3. [SOLVED] Conditionally calculate the data and paste it, if condition Matches
    By dumdumbum in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-02-2020, 11:33 PM
  4. [SOLVED] If data matches then clear the data by vba
    By dumdumbum in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 06-02-2020, 12:50 PM
  5. If condition matches copy data from one sheet to another
    By ravindra2k13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-14-2018, 06:14 AM
  6. [SOLVED] Condition 2 matches or partial match Data retrieve
    By irajeev in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-21-2016, 04:58 PM
  7. How do you count data that matches more than one condition?
    By ryesworld in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-08-2005, 09:00 PM

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