+ Reply to Thread
Results 1 to 3 of 3

Macro finding text and replacing text

  1. #1
    Registered User
    Join Date
    08-06-2013
    Location
    Quebec
    MS-Off Ver
    Excel 2013
    Posts
    31

    Macro finding text and replacing text

    I have loads of rows in my tab that look like this:

    31 45 76 74 100 33 10 55 1 17 0
    So there's a space at the beginning, 2 spaces between each serie of characters (there are always 11 of them, and they can either be 1, 2 or 3 characters long, it's pretty random) and there's another space at the end of the line.

    These rows start at number 3 and go on with jumps of 20 (so 3, 23, 43, 63, etc.).

    There's also another series of rows that is important. These are rows 21, 41, 61, etc. These rows look like this :

    5 0 25 84 0
    So now a space up front, then 5 series of numbers (each separated by 2 spaces), and then another space to finish.

    What I would like my macro to do is:

    - Look in the row 3 (and +20's rows) for the 8th serie of characters

    In the previous example ( 31 45 76 74 100 33 10 55 1 17 0 ), 55 would be the sequence.

    - If this number is 30 < x > 61, go in line 21 and change the 4 serie of character to "99".

    For example, the sequence found was 55, and 30 < 55 > 61, then go in the 21st line ( 5 0 25 84 0 ). The 4th series of character is the "84", which would be substituted by "99".

    Then do the exact same process 20 lines lower (row 23 and row 41).

    Could anyone help me? I'm so bad at programming :\

    Thank you so much.

    I hope everythink's clear enough.

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Macro finding text and replacing text

    Hi,
    Assuming the data is in column A, try this :

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-06-2013
    Location
    Quebec
    MS-Off Ver
    Excel 2013
    Posts
    31

    Re: Macro finding text and replacing text

    Merci beaucoup!

+ 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. IF function: Using text in logical_test with multiple variables and replacing with text
    By SarahRachelJones in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-25-2012, 02:17 PM
  2. Replacing Japanese text via Macro in Excel 2011 for Mac
    By cheaperThanAPro in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-12-2011, 06:01 PM
  3. finding and replacing text in charts
    By nataliem in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 07-29-2009, 02:13 AM
  4. Replies: 2
    Last Post: 11-02-2005, 06:17 PM
  5. Finding text and replacing in VBA
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-12-2005, 10:06 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