+ Reply to Thread
Results 1 to 10 of 10

canceled and restore arrows are grayed out in Excel with this macro

  1. #1
    Registered User
    Join Date
    07-31-2013
    Location
    FRANCE
    MS-Off Ver
    Excel 2003
    Posts
    27

    canceled and restore arrows are grayed out in Excel with this macro

    Hello

    I use the following code to assign a color based on text input.

    The code works perfectly to fulfill this task
    .
    By cons, it is possible for me to do a restore (crtl + Z)
    or cancel an entry (crtl + Y)

    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    For Each Cell In Target
    Select Case Cell.Value
    Case "GAME1"
    Cell.Font.ColorIndex = 3
    Case "GAME2"
    Cell.Font.ColorIndex = 4
    Case "GAME3"
    Cell.Font.ColorIndex = 5
    Case Else
    Cell.Font.ColorIndex = 56
    End Select
    Next
    End Sub

    Thank you for your helpTEST1.xlsm

    Gibtoul

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: canceled and restore arrows are grayed out in Excel with this macro

    if you run code, the undo stack is cleared-there is no way around that although you can write a routine to undo your changes and assign that to application.undo (you will still lose the rest of the undo history though)
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    07-31-2013
    Location
    FRANCE
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: canceled and restore arrows are grayed out in Excel with this macro

    Thank you for the answer
    I'm not an expert,
    can you help me to solve my problem by changing the code.

    thank you

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: canceled and restore arrows are grayed out in Excel with this macro

    it depends on what you want to cancel-to completely undo the changes would be very complicated. using conditional formatting for this would be much simpler

  5. #5
    Registered User
    Join Date
    07-31-2013
    Location
    FRANCE
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: canceled and restore arrows are grayed out in Excel with this macro

    To complement and possibly a solution:

    Is it possible to run the macro for example
    on sheet1 the ranges A1: B100 and C4: C58
    on Sheet2 in the range E2: E59 ....

    And outside these ranges, I find the Undo function and restore

    Thank you for your help

    gibtoul

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: canceled and restore arrows are grayed out in Excel with this macro

    perhaps
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-31-2013
    Location
    FRANCE
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: canceled and restore arrows are grayed out in Excel with this macro

    Thank you for your answer

    I pasted the code, but apparently it not work

    gibtoul

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: canceled and restore arrows are grayed out in Excel with this macro

    in what way-it does for me?

  9. #9
    Registered User
    Join Date
    07-31-2013
    Location
    FRANCE
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: canceled and restore arrows are grayed out in Excel with this macro

    I'll attach the file.
    celulles or the seizure is game1 ... does not take the color

    gibtoul
    Attached Files Attached Files

  10. #10
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: canceled and restore arrows are grayed out in Excel with this macro

    you must change the sheet names in the code to match your actual sheets
    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)

Similar Threads

  1. average duration for canceled bills
    By kghisla in forum Excel General
    Replies: 3
    Last Post: 12-04-2010, 08:28 PM
  2. [SOLVED] Macro edit button grayed out in excel 2007
    By QIP in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-07-2009, 05:35 AM
  3. Excel macro for sort arrows like Outlook
    By Macro Stu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-04-2006, 03:35 PM
  4. Workbook_BeforeClose event is not canceled
    By Mircea Pleteriu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2005, 11:05 AM
  5. WorkbookBeforeClose event is not canceled
    By Mircea Pleteriu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-03-2005, 12:05 AM

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