+ Reply to Thread
Results 1 to 7 of 7

Delete Cell Value after Macro Runs

  1. #1
    Registered User
    Join Date
    06-17-2013
    Location
    Salt Lake City, UT
    MS-Off Ver
    Excel 2011
    Posts
    26

    Delete Cell Value after Macro Runs

    I have this Macro working exactly how I need, except one thing. Currently when I enter a value into cell D2 it executes the macro. I want to make it so that after the macro is executed it deletes the value in cell D2. I'm not sure how or what to add. Any help on this?

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 06-18-2013 at 07:53 PM. Reason: Added CODE tags, as per Forum Rules. Take a moment to read the Forum Rules in the menu bar above. Thanks.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Delete Cell Value after Macro Runs

    Use this at the end:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Delete Cell Value after Macro Runs

    Quote Originally Posted by brown3218 View Post
    I have this Macro working exactly how I need, except one thing. Currently when I enter a value into cell D2 it executes the macro. I want to make it so that after the macro is executed it deletes the value in cell D2. I'm not sure how or what to add. Any help on this?

    Please Login or Register  to view this content.
    One part of your code is confusing. rCell is range A1
    Then you search all of column A for A1's value. It will always match in row 1 because you're searching for A1's value in column A.

  4. #4
    Registered User
    Join Date
    06-17-2013
    Location
    Salt Lake City, UT
    MS-Off Ver
    Excel 2011
    Posts
    26

    Re: Delete Cell Value after Macro Runs

    I tried the code and I got a runtime error. This is what I put.

    Please Login or Register  to view this content.
    Last edited by brown3218; 06-18-2013 at 10:01 PM.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Delete Cell Value after Macro Runs

    ============
    I fixed your post #1, but you've repeated the same error again, so now it's your turn.
    ============
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code in [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    ============
    When you joined the forum recently you agreed to abide by the Forum Rules, but in haste I fear you might not have actually read them. Please stop and take a moment to read them now. We all follow these rules for the benefit of all, as must you. Thanks.

    (link above in the menu bar)

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Delete Cell Value after Macro Runs

    Can you indicate which line of code is erroring when you click on DEBUG?

  7. #7
    Registered User
    Join Date
    06-17-2013
    Location
    Salt Lake City, UT
    MS-Off Ver
    Excel 2011
    Posts
    26

    Re: Delete Cell Value after Macro Runs

    Please Login or Register  to view this content.

+ 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