+ Reply to Thread
Results 1 to 4 of 4

clear contents vs delete

  1. #1
    Registered User
    Join Date
    12-05-2014
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    12

    clear contents vs delete

    Greetings all,
    I have a spreadsheet and on the spreadsheet I have many named ranges. I have quite a few sub routines on the worksheet change event

    for example

    cell b22 is named range vdom1
    cell b23 is named range vdom2
    cell b23 is named range vdom3
    cell b24 is named range vdom4

    I have a worksheet change event sub for each of the above that will hide or make visible other rows on other sheets. if I for example delete the contents of b22 then the worksheet change happens properly, same if I delete the contents of cell b23. If I select all of the cells and then clear contents it does not trigger the worksheet change events. I am going to asssume that the users will select all cells like above and say clear contents to start over. Is there some way to say that if a user selects multiple named range cells and then says clear contents that it will run the sub routines for those cells?

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: clear contents vs delete

    Can you post the code for the sheet change event?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    12-05-2014
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: clear contents vs delete

    Below is one of the grouping of change events. And if I am on the page where they named range is at and select delete, then the change event is in fact triggered. it is just when I want to reset all named ranges by selecting them on the sheet, right clicking and then selecting clear contents.

    I have attached a copy of the spreadsheet. The values I want to be able to clear contents of are in cells b29 through B31 or any combination of that. So I could just slect b30 through B31, right click and say clear contents. But then if you go to page named zone_Int_Conf you will see that the name portion is removed, but the cells are not hidden like they should be.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,943

    Re: clear contents vs delete

    If you use Target.Address and select four cells, the address will not match any of the single cell addresses that you specify. You should use Intersect to check which cell(s) is/are selected.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Clear merged cell contents in comand button(clear all)
    By mohan_984 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-25-2015, 10:39 AM
  2. How to clear contents/delete rows on click of button
    By murchy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-03-2013, 09:11 AM
  3. code that will delete and clear specific contents in the workbook
    By Khanzaki in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-01-2013, 01:18 PM
  4. Modify Macro : Clear contents <> Delete
    By guatelize in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-25-2013, 06:09 AM
  5. Delete rows or Clear contents below a specific word is found in Column A
    By kishoremcp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-17-2012, 04:08 PM
  6. [SOLVED] Macro to clear & delete contents on other worksheets
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-04-2012, 06:15 PM
  7. [SOLVED] Delete/clear a cell based on another cells contents
    By jademaddy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2005, 02:06 PM

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