+ Reply to Thread
Results 1 to 6 of 6

Delete cell value 'c4' automatically at the time of closing the file

  1. #1
    Forum Contributor
    Join Date
    12-15-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    672

    Delete cell value 'c4' automatically at the time of closing the file

    Dear Experts,
    I want to delete the value of cell 'c4' at the time of closing the file automatically. Please suggest me a macro for it.
    Thanking you in anticipation.

    Mukesh

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Delete cell value 'c4' automatically at the time of closing the file

    Sub Auto_Close()
    Range("C4").FormulaR1C1 = ""
    End Sub

  3. #3
    Forum Contributor
    Join Date
    12-15-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    672

    Re: Delete cell value 'c4' automatically at the time of closing the file

    Hello mehmetcik,
    Thank you but it's not working automatically. I have to manually run the macro by clicking. I want to delete the value of cells 'b4, c4' automatically at the time of closing the file. There is a little modification in cell address because in the morning I forgot to mention it. I want to delete the value of both cells 'b4, c4' automatically at the time of closing the file and make the cells blank. Next time when I open the file the cells must be blank for use.
    Thanking you in anticipation.
    Please see the attachment. I want to delete the names at the time of closing the file:
    Baviskar 'b4' and Mukesh 'c4'

    Mukesh
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Delete cell value 'c4' automatically at the time of closing the file

    I love this kind of stuff

    Try pasting this code into the "ThisWorkbook" module.

    Please Login or Register  to view this content.
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  5. #5
    Forum Contributor
    Join Date
    12-15-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    672

    Re: Delete cell value 'c4' automatically at the time of closing the file

    Hello mc84excel,
    I pasted the code in the module and run it but I'm getting error name conflict with vba object. I gave the name workbook_beforeclose.
    Please send me a sample attached file with code for better understanding.
    Thanking you in anticipation.

    Mukesh

  6. #6
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Delete cell value 'c4' automatically at the time of closing the file

    Quote Originally Posted by mukeshbaviskar View Post
    Please send me a sample attached file with code for better understanding.
    See attached.
    1. Download
    2. Open (Enable Macros if any macro message appears)
    3. Enter something in Sheet1 cells B4 and C4
    4. Save & Close the workbook
    5. Open the workbook. Cells B4 & C4 should be empty.

    Please mark the thread as solved if this works for you.
    Attached Files Attached Files
    Last edited by mc84excel; 06-02-2013 at 09:58 PM.

+ 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