+ Reply to Thread
Results 1 to 5 of 5

Delete all cells on a sheet?

  1. #1
    Registered User
    Join Date
    12-19-2007
    Posts
    3

    Delete all cells on a sheet?

    Hey all =D
    First of all, I'm sorry for asking how to solve a whole problem, instead for asking for help on a specific thing. I would try and solve this on my own, but I know nothing about VBA and am totally out of time (and need to deliver this soon).
    I intend to find tutorials on the internet and learn how to deal with excel on my own. However, like I said, I have no time for this right now.
    What I need to do is, I believe, very simple.
    I want to put a button on my sheet that calls a function that will clear every cell on the sheet, except for those cells that have text and formulas in it.
    I already know where to write the macros and stuff like that, all I need is the code.
    Any help will be appreciated. If you guys give me the whole code, I be able to understand it, like, how to iterate through all cells in a sheet, how to check their content, etc. However, if you prefer to indicate me where I can read about these concepts, the result will be the same.
    Thanks a lot!!!

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    What do the cells to delete contain?

    What you need to do is protect & lock all the formula cells, and text if you don't want the user to change it. Then you can clear all unlocked cells.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    12-19-2007
    Posts
    3
    The cells I want to delete contain numbers only.
    Very good idea, will do that now.
    Thanx!

    Edit:
    Well, it doesn't seem to solve my problems.
    I locked the cells I don't want to delete and then proceeded to delete all cells, hoping it would delete everything that wasn't blocked. But, all it does is display a message warning me that the cells are blocked and quit the process.
    Last edited by TaviO!; 12-19-2007 at 08:34 AM.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486
    Try this
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-19-2007
    Posts
    3
    Worked perfectly. Thanks a lot you all!
    Close topic

+ 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