+ Reply to Thread
Results 1 to 5 of 5

Clear Cell in VBA not FormulaR1C1 = ""

  1. #1
    Forum Contributor
    Join Date
    09-13-2012
    Location
    Atlanta, USA
    MS-Off Ver
    Office 2003, 2010
    Posts
    230

    Clear Cell in VBA not FormulaR1C1 = ""

    Hi everyone,


    I am trying to create a macro that will clear the contents of a cell with a conditional drop down value. I have a main drop down, and a conditional. If the main one is cleared or changed, I would like the cascading drop down to also clear.

    I need the formatting to remain the same, though, so I cannot simply delete the cell.

    My issue arises when I use the code:

    Please Login or Register  to view this content.
    For some reason, this change takes 5 - 8 seconds to implement, and it completely locks up excel in the mean time. Without this single line of code, all my other macros run instantly. Is there some sort of strange effect with clearing a drop down? And if so, does anyone know of another line of code which would work better to clear the contents of the cell?

    Thanks for the help.

  2. #2
    Forum Contributor bonny24tycoon's Avatar
    Join Date
    04-02-2012
    Location
    Hell
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    405

    Re: Clear Cell in VBA not FormulaR1C1 = ""

    Try adding this at the start of your macro -

    Please Login or Register  to view this content.

    And then add this before your macro ends -

    Please Login or Register  to view this content.
    Let me know if it speeds up the process??
    Thanks,

    Bonny Tycoon


  3. #3
    Forum Contributor
    Join Date
    09-13-2012
    Location
    Atlanta, USA
    MS-Off Ver
    Office 2003, 2010
    Posts
    230

    Re: Clear Cell in VBA not FormulaR1C1 = ""

    Thanks for the help. Maybe it is places in the wrong place...

    How far into the code should this be placed? Most of my other pieces don't work when I put this in there, strangely enough including the clearing of that cell...

    It is based on a select case code, should this be within the case, or just before the case statement, or right after the declarations?

  4. #4
    Forum Contributor bonny24tycoon's Avatar
    Join Date
    04-02-2012
    Location
    Hell
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    405

    Re: Clear Cell in VBA not FormulaR1C1 = ""

    After the declarations and before the end sub line.

  5. #5
    Forum Contributor
    Join Date
    09-13-2012
    Location
    Atlanta, USA
    MS-Off Ver
    Office 2003, 2010
    Posts
    230

    Re: Clear Cell in VBA not FormulaR1C1 = ""

    That is where I figured it should go. It causes much of my code to not run.

+ 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