+ Reply to Thread
Results 1 to 18 of 18

If one cell in line turn empty then entire line turns empty

  1. #1
    Registered User
    Join Date
    07-18-2013
    Location
    Sao Paulo
    MS-Off Ver
    Excel 2007
    Posts
    14

    If one cell in line turn empty then entire line turns empty

    Hello everyone.

    I would like to get some help.

    I have a very large worksheet and I would like if, as example, if I delete content of 1 cell in specific line to entire line turn empty together.

    How do I do that?

    I was thinking in adding a button for "update" the worksheet before closing...

    Thanks in advance.

  2. #2
    Forum Contributor
    Join Date
    07-24-2012
    Location
    Denver, CO
    MS-Off Ver
    365
    Posts
    230

    Re: If one cell in line turn empty then entire line turns empty

    You can run a loop that checksfor empty cells and then deletes the entire row. It might look something like this:
    Please Login or Register  to view this content.
    Last edited by LaffyAffy13; 07-18-2013 at 11:09 AM. Reason: Changed info to "Clear Contents" instead of "Delete"
    ~~LaffyAffy13~~

    If I have helped you solve your problem, please be sure to click at the bottom left of my post.

    Thanks.

  3. #3
    Forum Contributor
    Join Date
    07-24-2012
    Location
    Denver, CO
    MS-Off Ver
    365
    Posts
    230

    Re: If one cell in line turn empty then entire line turns empty

    And then add the macro to your "Update" button.

  4. #4
    Registered User
    Join Date
    07-18-2013
    Location
    Sao Paulo
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: If one cell in line turn empty then entire line turns empty

    Hello, thank you for your patience and attention, but if possible I would like instead of delete the row, to just clear content on rest of cells of this row...

    Would it be possible?

    Regards.

  5. #5
    Forum Contributor
    Join Date
    07-24-2012
    Location
    Denver, CO
    MS-Off Ver
    365
    Posts
    230

    Re: If one cell in line turn empty then entire line turns empty

    Of course! Check the code, I edited it.

  6. #6
    Registered User
    Join Date
    07-18-2013
    Location
    Sao Paulo
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: If one cell in line turn empty then entire line turns empty

    Quote Originally Posted by LaffyAffy13 View Post
    Of course! Check the code, I edited it.
    Thank you very much!

    But how do I change R1C1 for work only in the range B4:K3000? And if not much work to ignore lines that contain formulas? (is it called formula in english? not sure...)

  7. #7
    Forum Contributor
    Join Date
    07-24-2012
    Location
    Denver, CO
    MS-Off Ver
    365
    Posts
    230

    Re: If one cell in line turn empty then entire line turns empty

    Yes, they are called formulas. You want to clear the contents of any row that contains an empty cell, specifically in the range "B4:K3000", but ignore all rows with any cells that contain a formula? Am I understanding that correctly?

  8. #8
    Registered User
    Join Date
    07-18-2013
    Location
    Sao Paulo
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: If one cell in line turn empty then entire line turns empty

    Quote Originally Posted by LaffyAffy13 View Post
    Yes, they are called formulas. You want to clear the contents of any row that contains an empty cell, specifically in the range "B4:K3000", but ignore all rows with any cells that contain a formula? Am I understanding that correctly?
    No I want macro to ignore specific cells which contain formulas. I have uploaded an sample sheet for better understanding.

    Link: http://temp-share.com/show/dPf3UCA5W

    In C column if you click from C4 and down you'll see there's a formula for changing suppliers name. I didn't wanted it to be changed...

    Thank you again.

  9. #9
    Forum Contributor
    Join Date
    07-24-2012
    Location
    Denver, CO
    MS-Off Ver
    365
    Posts
    230

    Re: If one cell in line turn empty then entire line turns empty

    I'm working on it, give me like 15 minutes.

  10. #10
    Forum Contributor
    Join Date
    07-24-2012
    Location
    Denver, CO
    MS-Off Ver
    365
    Posts
    230

    Re: If one cell in line turn empty then entire line turns empty

    Alright. I noticed the code deleted your purple chart contents as well, so I have fixed that. Also, I place the formula into the cells C4 to C3000 after they have been cleared. Is this okay? Sorry it is so long, I had to find a way to save your purple chart.
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    07-18-2013
    Location
    Sao Paulo
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: If one cell in line turn empty then entire line turns empty

    Oh my God! You're great!

    It seemed so easy to you for making all this long code!

    I would like to ask you one more favor if possible. Could you imput after the functions notes like 'here I change the cells colors and so on?

    Because I really would like to learn VBA and for that I would like to understand what each thing is doing in the code.

    But just if you have time.

    Thank you so much!

  12. #12
    Forum Contributor
    Join Date
    07-24-2012
    Location
    Denver, CO
    MS-Off Ver
    365
    Posts
    230

    Re: If one cell in line turn empty then entire line turns empty

    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    07-24-2012
    Location
    Denver, CO
    MS-Off Ver
    365
    Posts
    230

    Re: If one cell in line turn empty then entire line turns empty

    Hope that helps!

  14. #14
    Registered User
    Join Date
    07-18-2013
    Location
    Sao Paulo
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: If one cell in line turn empty then entire line turns empty

    Quote Originally Posted by LaffyAffy13 View Post
    Hope that helps!
    Thank you!

    I know my main question is already solved but I thought in not creating a new thread for one more question about same worksheet.

    You see next to columns that should be filled with dates there are a small cell for numbers which goes like this:

    If date of billing is like 9/21/13 then it should be filled with number 9 which means month 9 as mentioned on table of caption. At this moment it will be filled manually since I could not make a formula for IF in these cells because of date. Would you know by chance a easy way to automatically fill the number of month right after imputting the date on month cell?

    Kind regards!

  15. #15
    Forum Contributor
    Join Date
    07-24-2012
    Location
    Denver, CO
    MS-Off Ver
    365
    Posts
    230

    Re: If one cell in line turn empty then entire line turns empty

    I'll see if I can figure it out.
    Last edited by LaffyAffy13; 07-18-2013 at 04:50 PM.

  16. #16
    Forum Contributor
    Join Date
    07-24-2012
    Location
    Denver, CO
    MS-Off Ver
    365
    Posts
    230

    Re: If one cell in line turn empty then entire line turns empty

    Ignore this, I tried to delete it but don't know how.
    Last edited by LaffyAffy13; 07-18-2013 at 04:59 PM.

  17. #17
    Forum Contributor
    Join Date
    07-24-2012
    Location
    Denver, CO
    MS-Off Ver
    365
    Posts
    230

    Re: If one cell in line turn empty then entire line turns empty

    I do not think that is easily possible. Dates are not considered text, they are considered numbers. For instance, today's date is equivalent to 41473. So I can't grab anything from "41473" that will give you the current month because I do not know where excel gets these numbers from. But if you read into it, you may be able to figure it out. I am sorry that I can't help you with this. You may consider creating a new thread and asking this question there. Someone else may know how to do this. If you do, you can provide a link to this thread, but it does not match this thread's contents, so I would just create a new one and provide the same link you gave me. I hope you figure things out!

  18. #18
    Registered User
    Join Date
    07-18-2013
    Location
    Sao Paulo
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: If one cell in line turn empty then entire line turns empty

    No problem, you already helped me alot.

    Thank you very much!

+ 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. Check range A10 to A45 and if cell not empty then same line in B must have value
    By CAVA30 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-08-2013, 09:25 PM
  2. Need to delete the empty line
    By hisham_a_j in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 05-28-2012, 05:22 AM
  3. Paste in next empty line
    By Doolafs in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-05-2010, 07:24 AM
  4. Line chart-lot of empty cell
    By missing in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-14-2006, 06:42 AM
  5. If value in column is yes; entire line turns red
    By Geert_Pick in forum Excel General
    Replies: 2
    Last Post: 03-03-2006, 03:50 AM

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