+ Reply to Thread
Results 1 to 8 of 8

VBA: Script that changes new text to another color

  1. #1
    Registered User
    Join Date
    02-25-2014
    Location
    NJ, US
    MS-Off Ver
    Excel 2010
    Posts
    5

    VBA: Script that changes new text to another color

    Hello, this may be impossible, but I need a script that will change the color of new text entered in a cell. What I have right now changes the whole text color in the cell, I only need the specific text that was modified. This is what I have (the code was found in this forum by User: Palmetto) Any ideas?

    Please Login or Register  to view this content.
    Last edited by alansidman; 02-26-2014 at 11:53 AM. Reason: Code tags added

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: VBA: Script that changes new text to another color

    Hi,

    Try this code
    Please Login or Register  to view this content.
    I hope this helps

  3. #3
    Registered User
    Join Date
    02-25-2014
    Location
    NJ, US
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA: Script that changes new text to another color

    Thanks you very much. I have another question, how can we make it that only works for this matrix cell A9-L300? Also, options like select all, select column or row, undo, etc are not working. Any ideas?

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2507 Win 11
    Posts
    24,921

    Re: VBA: Script that changes new text to another color

    hector.febus
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between
    Please Login or Register  to view this content.
    tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: VBA: Script that changes new text to another color

    Hi again,

    The changes to the Worksheet_Change subroutine will restrict the range, and the changes to the Worksheet_SelectionChange subroutine will allow you to select rows, columns, and all.
    Please Login or Register  to view this content.
    As for the Undo function, one unfortunate side-effect of VBA is that you cannot undo a change made in VBA with the regular Undo function.

    I hope this helps

  6. #6
    Registered User
    Join Date
    02-25-2014
    Location
    NJ, US
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA: Script that changes new text to another color

    It worked perfectly. I will proceed to create a macro function that will back up the information in a temporary manner to compensate the UNDO loss. Thank you so much once again.

  7. #7
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: VBA: Script that changes new text to another color

    No problems!

    Please don't forget to mark this thread as solved, and please click on the * next to my post to say thanks

  8. #8
    Registered User
    Join Date
    02-25-2014
    Location
    NJ, US
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA: Script that changes new text to another color

    Hello again, sometimes I need to color something manually but the code doesn't allow me to it unless I delete the code from the module. Any ideas?

+ 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. Replies: 4
    Last Post: 12-29-2013, 11:41 PM
  2. script to write 1's and zero's for cell color
    By NPeters in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-07-2010, 01:52 PM
  3. VBA Script for Onclick Color Formatting
    By Solar in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-02-2009, 01:46 PM
  4. Script that edits the text printed on the button that runs the script
    By petalred in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2008, 02:41 PM
  5. Replies: 1
    Last Post: 06-27-2006, 10:00 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