+ Reply to Thread
Results 1 to 10 of 10

Macro - Clear cell contents based on other cell

  1. #1
    Registered User
    Join Date
    02-05-2011
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    31

    Macro - Clear cell contents based on other cell

    Simple one for most on here but any help will be greatly appreciated.

    I need a macro that will look at a range (AX5:AX2000), if a cell in that range = 1 then it will delete the corresponding cell on that row in columns Q:S.

    Thanks in advance!

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro - Clear cell contents based on other cell

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Macro - Clear cell contents based on other cell

    Hi.

    You can try this too:

    Please Login or Register  to view this content.
    Click *, if my suggestion helps you. Have a good day!!

  4. #4
    Registered User
    Join Date
    02-05-2011
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    31

    Re: Macro - Clear cell contents based on other cell

    Thanks guys. They both work but is there any way to make them quicker?

    Of the 2000 or so rows there will be anywhere between 20% and 90% that will need to be cleared so this is taking quite a long time.

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro - Clear cell contents based on other cell

    Try this one

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-05-2011
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    31

    Re: Macro - Clear cell contents based on other cell

    Quote Originally Posted by AB33 View Post
    Try this one

    Please Login or Register  to view this content.
    Wow, what a hero! Thanks

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro - Clear cell contents based on other cell

    97hills,
    You are welcome!

    Could you please now close (Mark) this thread as solved? Go in to the top right-hand side of this page, choose "Thread Tools" from the menu, then select "solved" from the drop down menu.

  8. #8
    Registered User
    Join Date
    02-05-2011
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    31

    Re: Macro - Clear cell contents based on other cell

    Quote Originally Posted by AB33 View Post
    97hills,
    You are welcome!

    Could you please now close (Mark) this thread as solved? Go in to the top right-hand side of this page, choose "Thread Tools" from the menu, then select "solved" from the drop down menu.
    I'll admit I'm a complete novice when it comes to VBA but I'm usually able to figure it out once I can see the code. This one I don't have a clue how it works! I was hoping to be able to edit it and use it for another purpose but can't figure out what you've done.

    It's pretty similar but instead of clearing whatever is in cells Q:S I just need the value "X" to be written in Q only.

    Again, thanks and I'll make sure I mark the thread as solved

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro - Clear cell contents based on other cell

    97 hills,
    Please do not reply with quote- It has not purpose other than to clutter the space of this page.
    Back to the slow code.

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    02-05-2011
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    31

    Re: Macro - Clear cell contents based on other cell

    Great, thanks

+ 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