+ Reply to Thread
Results 1 to 35 of 35

Delete cel is som row is >1

  1. #1
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Delete cel is som row is >1

    I searching for a script that deletes cell a1 sheet ''buy'', if the som of row a1:a10 sheet ''sell'' >1

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Delete cel is som row is >1

    typed without excel

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: Delete cel is som row is >1

    Converted to my sheets it doesn't work. Is VBA understands "l to S"?
    Please Login or Register  to view this content.

  4. #4
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Delete cel is som row is >1

    What these letters are? Why there are "102" in code?
    Do you want to checking by columns? It won't working like that.
    Attached file with sample data, maybe we can help You more.

  5. #5
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: Delete cel is som row is >1

    I can't share the sheet with you. Ik can make en example sheet.

    The 102 is te row.
    If row 102 L to S > 1
    Then Sheets("Chemicalien").Range("O3").Value = ""

  6. #6
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Delete cel is som row is >1

    Do you mean cells L102:S102?
    You've said A1:A10 >1.

  7. #7
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Delete cel is som row is >1

    Sounds like you want sum of row 102, columns L tot S?

    Please Login or Register  to view this content.
    *Ik weet niet of dat in Nederlands excel precies zo wordt geschreven? Sum is in youw excel Som?
    Last edited by Arkadi; 02-01-2019 at 09:44 AM.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  8. #8
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: Delete cel is som row is >1

    That is what i want. But you code give a error at Cells(102, 12)

  9. #9
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Delete cel is som row is >1

    Worked on my computer.. maybe we try range instead of cells:

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: Delete cel is som row is >1

    Nope error at Range("L102")

  11. #11
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Delete cel is som row is >1

    Let's see if that is really the problem.... try just one simple line of code:

    Please Login or Register  to view this content.
    Does that work?

  12. #12
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: Delete cel is som row is >1

    Same "L102" error

  13. #13
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Delete cel is som row is >1

    What is the error?

  14. #14
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: Delete cel is som row is >1

    Find it strange that there is no basi function in excel that clears/delete a cell in a Iff function

  15. #15
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Delete cel is som row is >1

    type was there

    Please Login or Register  to view this content.

  16. #16
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Delete cel is som row is >1

    It would be great if you could upload a sample workbook. Include the exact same sheet names and code that gives error.

  17. #17
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Delete cel is som row is >1

    That could help KOKOSEK, but what I posted worked on my end. Besides, the test I asked him to do gave the same issue. Which was just a basic one cell range

  18. #18
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: Delete cel is som row is >1

    They all give the same error.
    In dutch: Ongeldig buiten procedure.

    Something like: Invalid outside procedure

  19. #19
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Delete cel is som row is >1

    can you show all code in your module please?

  20. #20
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: Delete cel is som row is >1

    Can i just copy paste a If Application in a module?

  21. #21
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Delete cel is som row is >1

    I think the problem is you didn't put the code INSIDE a sub? I just assumed that was a given, but maybe I should have been more detailed.

    Please Login or Register  to view this content.

  22. #22
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: Delete cel is som row is >1

    That was it. I'm sorry. Very new to VBA. No more error. But no empty "O2"

    There is a 1 in L102 en a date in 03. When i push play in de VBA screen nothing happend

  23. #23
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Delete cel is som row is >1

    You Said > 1.... so just 1 is not enough to erase O3...

    if you mean 1 or more, (meer dan 0 in plaats van 1), then change ""> 1" to "> 0"

  24. #24
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: Delete cel is som row is >1

    That is it. Works like a charm and learnt something. Thanks.

  25. #25
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Delete cel is som row is >1

    Graag gedaan! Please remember to mark the thread as solved? Thanks

  26. #26
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: Delete cel is som row is >1

    One more question.
    I copy paste the line in 13 lines and changed code to fit other lines and cells. But the other cells don't clear.
    And this will run if i refresh excel. Is it possible to run it only in a macro?

    Sorry two questions!

  27. #27
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Delete cel is som row is >1

    And this will run if i refresh excel. Is it possible to run it only in a macro?
    What does that mean? I don't know where you put the code, but if you have put the code in a normal module, it SHOULD only run when you use the macro.

    Can you also paste the code you tried for the other 13 lines? Then I can try to see what is wrong.

  28. #28
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: Delete cel is som row is >1

    Please Login or Register  to view this content.

  29. #29
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Delete cel is som row is >1

    Ok... are there numbers in rows 103, 104, etc? because your code is correct. However, a much simpler version:

    Please Login or Register  to view this content.
    Please provide a workbook if you still have problems. Include the 2 sheets, and the data that is in there when it is not working.

    To Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  30. #30
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Delete cel is som row is >1

    Long, long story short:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and drag it down

    I've ignored sheet name in formula.

  31. #31
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: Delete cel is som row is >1

    This is it! Thanks. Dankjewel.

  32. #32
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Delete cel is som row is >1

    @KOKOSEK that formula only adds L102 and S102, not the cells in between. But it is a good idea if the O3 value can be put in the formula, we just don't know what the source of the data is.

  33. #33
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Delete cel is som row is >1

    Quote Originally Posted by Frigide View Post
    This is it! Thanks. Dankjewel.
    Graag gedaan... als je het tegen mij had?

  34. #34
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Delete cel is som row is >1

    Quote Originally Posted by Arkadi View Post
    @KOKOSEK that formula only adds L102 and S102, not the cells in between. But it is a good idea if the O3 value can be put in the formula, we just don't know what the source of the data is.
    Sorry of course:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and another of course, that we all day long guessing.....

  35. #35
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Delete cel is som row is >1

    @Frigide If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

    Bedankt also for the rep!

+ 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. VBA code to delete the FILTERED range and moving the cell up (dont Delete entire row)
    By mchilapur in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-14-2015, 07:48 AM
  2. Replies: 1
    Last Post: 11-30-2013, 06:37 AM
  3. Replies: 16
    Last Post: 07-25-2012, 02:03 AM
  4. Macro to delete certain columns and delete rows based on time in another column
    By beepbeep27 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2012, 11:47 AM
  5. [SOLVED] Macro to delete sheets and saves remaining file does not properly delete module
    By pherrero in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-21-2005, 08:12 PM
  6. Replies: 0
    Last Post: 06-21-2005, 01:05 PM
  7. [SOLVED] Re: Macro to delete sheets and saves remaining file does not properly delete module
    By pherrero in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-21-2005, 01:05 PM

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