+ Reply to Thread
Results 1 to 5 of 5

I need to change the codes and let it reverses the colors back.

  1. #1
    Registered User
    Join Date
    08-13-2014
    Location
    Istanbul
    MS-Off Ver
    2013
    Posts
    59

    I need to change the codes and let it reverses the colors back.

    With this macro, after I select 1, I can search and find a value and color it.
    Because of we can not use Ctrl Z after using a macro, I wanted to put Selection 2 to reverse colors back but when I select 2, it removes all the cell's original colors. What I wanted is I use Selection 1 to search, find and color it then I want to run the macro again and select 2 to reverse the colored cells back.

    Can you help me to fix the codes of Selection 2?
    Attached Files Attached Files
    Last edited by akinkaraman; 03-23-2015 at 12:29 PM.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: I need to change the codes and let it reverses the colors back.

    Hi akinkaraman,

    Thanks for the rep points.

    Try the following code which is included in the attached updated copy of your file:
    Please Login or Register  to view this content.
    0a. To prevent typos from ruining days and weeks of work 'Option Explicit' is NEEDED at the top of each code module. This prevents errors caused by missspellings and FORCES every variable to be DECLARED (e.g. Dim i as Integer). http://www.cpearson.com/excel/DeclaringVariables.aspx

    Lewis

  3. #3
    Registered User
    Join Date
    08-13-2014
    Location
    Istanbul
    MS-Off Ver
    2013
    Posts
    59

    Re: I need to change the codes and let it reverses the colors back.

    I am really very very appreciated. It is awesome and working wondeful.

    I want to ask one thingh while I check the codes. When I search TR* it finds TRIP but when I search tr* it can not find TRIP . Is there a solution for big letters and small letters?
    Last edited by akinkaraman; 03-23-2015 at 01:57 PM.

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: I need to change the codes and let it reverses the colors back.

    For the search to be Case Insensitive (match any combination of upper and lower case text) add the 'Option Compare Text' line immediately below 'Option Explicit'.

    Please Login or Register  to view this content.
    Lewis
    Last edited by LJMetzger; 03-23-2015 at 02:40 PM. Reason: Added attachment

  5. #5
    Registered User
    Join Date
    08-13-2014
    Location
    Istanbul
    MS-Off Ver
    2013
    Posts
    59

    Re: I need to change the codes and let it reverses the colors back.

    Awesome. You are a master LJMetzger. Thank you so much.

+ 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. Using a macro on workbook1 to create a button in wb2 and assigning macro "wb2!macro"
    By penfold1992 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-13-2014, 11:39 AM
  2. [SOLVED] Macro to show Which macro didnt work in a nested macro
    By akhileshgs in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-10-2013, 03:21 AM
  3. Perform macro "on open" specific file- store macro in Personal Macro Workbook?
    By thompssc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2012, 12:38 PM
  4. lookup macro, solver macro, realtime macro
    By xelhelp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2011, 06:14 PM
  5. Cannot find macro error when running a macro from a macro in a diffrent workbook.
    By Acrobatic82 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2010, 09:22 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