+ Reply to Thread
Results 1 to 7 of 7

Event Macro - Clear a group of cells

  1. #1
    Registered User
    Join Date
    09-27-2007
    Posts
    14

    Event Macro - Clear a group of cells

    Hello,
    I would like to clear the contents of a group of cells base on the value of a single cell.
    I have:
    It loops until I hit ESC
    Can someone please help me refine my code?

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562
    jacobfromso,

    I set up a worksheet on my end based on the information you provided in your post. I put QRC in D11 and data in H11, I11, D12, E12, H12, and I12. The minute I entered a value anywhere on the sheet it cleared the cells it was suppose to and stopped. Basically, your code worked fine on my end.

    Is it possible for you to post your workbook so we can see if there is something else that is affecting thing on your end?
    Sincerely,
    Jeff

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe it's a enablevents issue

    Try


    Please Login or Register  to view this content.
    VBA Noob
    Last edited by VBA Noob; 10-19-2007 at 12:04 PM.
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Registered User
    Join Date
    09-27-2007
    Posts
    14
    VBA Noob
    That might have worked could you take a look at the attached and help me out?
    Since I'm new at this I've done what I could but I could use some expert help here I think I'm getting over my head.

    Thank you
    Attached Files Attached Files

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try removing the merge cells and use format > cells > alignment > centre across selection.

    Also move the non event macros to normal modules.

    then in a normal module enter this and run

    Please Login or Register  to view this content.
    This should turn events back on and event macro should work again

    VBA Noob

  6. #6
    Registered User
    Join Date
    09-27-2007
    Posts
    14
    I appreciate you looking at my worksheet but I have very little idea of what you are referring to.
    What are “normal modules”?
    What are modules for?
    What will “format>cells>alignment>center across selection do?
    What do you mean by “event macro”?

    Sorry for all the questions
    However after seeing what I can do with excel the more I want to do.
    Thank again

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    See link re modules.

    Normal module is known on here as regular module

    http://www.contextures.com/xlvba01.html

    See links re event macro's
    http://www.cpearson.com/excel/Events.aspx

    http://www.mvps.org/dmcritchie/excel/event.htm

    Instead of merging cells H12 and I12 it will make them look merge by center across selection. Sometimes you will have problems with code if cells are merged

    HTH

    VBA Noob

+ 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