+ Reply to Thread
Results 1 to 19 of 19

Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

  1. #1
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Good Morning all !!!!!!!!

    I'm successfully using a code to Search and Highlight string Formats in a single Cell,
    but i would-like to change or accept an additional formats,

    For example :

    Right now it work perfect searching and highlightig this format :
    01-02-03-04-05
    03-09-15-25-35
    10-15-25-35-36

    and i would like to change or accept an additional format like this :
    1,2,3,4,5
    3,9,15,25,35
    10,15,25,35,36


    Please Login or Register  to view this content.

    Thank you,



    Best Regards

    David

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Hello David,

    You can use this pattern...
    Please Login or Register  to view this content.
    However, this will not match a number unless it is followed by a comma.

    Any number not followed by a space or at the end of the string will be ignored. For example 1,2,4b. the 4b will not be included in the match
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Re: Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Hi Mr Leith Ross;
    I might doing something wrong,
    The pattern was added, and Let say in F1 i Input 1,3,15,25,36, then everything change to Red

    1,2,3,4,5
    3,9,15,25,35
    10,15,25,35,36



    Please Login or Register  to view this content.



    Thank you,



    Best Regards

    David

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Hello David,

    I am not sure I understand the problem. Any matching patterns in the cell are to be colored red. Your example indicates that.

    Are you saying ALL characters in the cell are red ?

  5. #5
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Re: Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Hi Mr Leith rosss,

    with Actual Format this code search and highlight the numbers that match from Cell F1 vs Column range V5 down,
    Let say i Input in F1 : 01,03,15,25,36, Then matched numbers in Col V5 down got highlighted
    as :

    01,02,03,04,05
    03,09,15,25,35
    10,15,25,35,36


    Desired code, i need to work with format 1,2,3,4,5 (not with 01,02,03,04,05)
    so necessary new output can be as :
    1,2,3,4,5
    3,9,15,25,35
    10,15,25,35,36



    Thank you so much and i'm sorry for the lacks of explanation..

    Best Regards

    David
    Last edited by david gonzalez; 10-01-2014 at 05:20 PM. Reason: explanation

  6. #6
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Re: Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Hi Leith Ross,

    yes sir, All the character in the cell are red.
    what i need is to color in red the matched numbers.



    Thank you,


    Best Regards

    David

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Hello Daid,

    Try this macro.
    Please Login or Register  to view this content.

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Hello Daid,

    Try this macro.
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Re: Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Hi mr Leith Ross,

    (I think the code is posted twice)

    It does't work, it highlight some matched numbers but also highlight some others numbers that don't match.




    Best Regards

    David

  10. #10
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Hello David,

    Since I am not really understanding what you want to do, you should post a workbook.

    Include a before and after example of the data. This should match your actual data.

    Include any notes, comments, or explanations you feel will help in explaining the end result.

    How To Post Your Workbook
    1. At the bottom right of the Reply window, Click the button Go Advanced
    2. At the top of the Your Message Window, in the first row of icons, Click the Paperclip icon.
    3. Click the Add Files button at the top right in the dialog box. This displays the File Manager dialog.
    4. Click the Select Files button at the bottom middle of the dialog.
    5. In the new window Find the file you want to upload, select it, and Click Open.
    6. You will now be back in the File Manager dialog. Click the bottom Middle button Upload File.
    7. Wait until the file has completely uploaded before you exit the File Manager dialog.

  11. #11
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Re: Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Hi mr Leith Ross,

    I'm sorry it took me so long, file was too big and i had to shrink it.

    Here the file,and on same sheet already have the 2 codes and search boxes with small numbers list with both Format


    Thank you !!


    Best Regards

    David
    Attached Files Attached Files

  12. #12
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Hello David,

    Here is the macro. It has been added to and tested on the attached workbook.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Re: Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Hi Mr Leith,

    Yes Sir, it worked !!!!!!!!!!!!
    I been reading about about VBA expression operator and is not easy..


    Thank you so much !!!!!!!!!!!!!


    Best Regards

    David

  14. #14
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Hello David,

    De nada. Próxima vez usted puede escribir sus preguntas en español.

    Thanks for marking your solved.

  15. #15
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Re: Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Hola Mr Ross,

    esta bien voy a tratar, para mi es un poco dificil la traduccion al español de la terminologias o nombres de formulas de excel.



    Muchas Gracias



    Saludes

    David.

  16. #16
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Hello David,

    Entendido. Puede escribir la fórmula nombres y terminología en inglés. Sí?

  17. #17
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Re: Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Hi Mr Ross,


    Claro que si..., Imaginese describiendo en español "COUNTIF" (CONTARSI) o "SUMPRODUCT" (SUMARPRODUCTO)

    Sound weird, verdad? lol..



    Saludes

    David

  18. #18
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Hello David,

    I am used to hearing Spanish and English words used together. In California it is very common. We call it Spanglish.

  19. #19
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Re: Modify VBA Code to Acept search & highlight Other string Format e.i 01-02,03 to 1,2,3

    Hi Mr Leith,

    En miami tambien se le dice Spanglish, antes era bien popular sobre todo en la comunidad cubano americana, pero ha ido desapareciendo, Hoy dia se ha vuelto bastante popular en los jovenes..
    Nosotros los viejos usamos el Spanglish cuando hablando Ingles no samos la traduccion correcta de una palabra de ingles a español, Entonces en medio de la conversacion we mix la palabra, Y el Interlocutor o sea la otra persona con la que conversamos contesta : "Ehhh ????" lol...

    Saludes

    David

+ 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. Modify connection string - VBA Code
    By MahmoudSa in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-02-2014, 09:57 AM
  2. [SOLVED] VBA Search for string, modify and re-enter
    By passman86 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-11-2013, 10:46 AM
  3. [SOLVED] Modify code to search first matching string from right to left.
    By rocksan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-10-2012, 12:47 AM
  4. Modify Search code to look for specified text
    By mrgillus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-27-2010, 01:23 PM
  5. modify code for search button
    By zebra in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-21-2009, 07:38 AM

Tags for this Thread

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