+ Reply to Thread
Results 1 to 5 of 5

Macro - autocolor on entry

  1. #1
    Registered User
    Join Date
    12-11-2008
    Location
    Berlin
    Posts
    2

    Macro - autocolor on entry

    Hi All,

    I would like to ask your help on the following:

    I work a lot with all kinds of models in Excel, and I would like to creat a macro which helps me audit and check the models.

    For this I would like that values in the cells which that are hard input automatically become blue (so font colour, not cell shading), formula results automatically become black and cell values which are linked from somewhere else automatically become green.

    I can do this manually every time I, but it would be much easier if there was a macro which automatically does this.

    Is this possible, and if yes, what would such a macro look like?

    Any help is appreciated, many thanks.

    t.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,474
    Hit F5,
    Select Special=>formulas then ok
    all cells with a formula will be selected, change the color of the selected cells,
    Do the same action for constants
    If you want a vba code for this, then perform the actions with the macro recorder on....

  3. #3
    Registered User
    Join Date
    12-11-2008
    Location
    Berlin
    Posts
    2
    Hi, thanks for your quick reply.

    I had thought about this approach before, but then I'd still have to run this macro every now and then. I would like to have them get their respective colors automatically, as I type.

    So I think the macro would have to recognize what kind of input it is, and subsequently change the font colour as soon as I hit enter/tab to leave the cell.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,474
    Once you have the code,place it in the worksheet change event
    Right click on the sheet tab and select view code
    Paste this code there
    Please Login or Register  to view this content.

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    maybe you could use the worksheet change event

    Please Login or Register  to view this content.
    To add this to your worksheet, do the following:

    Copy the code that you want to use
    Select the worksheet in which you the code to run
    Right click on the sheet tab and choose View Code, to open the Visual Basic Editor.
    Where the cursor is flashing, choose Edit | Paste
    Hope that helps.

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

    Free DataBaseForm example

+ 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