+ Reply to Thread
Results 1 to 7 of 7

How to generate a repeating text sequence

  1. #1
    Registered User
    Join Date
    02-25-2019
    Location
    Letchworth, Hertfordshire
    MS-Off Ver
    Excel for Mac 2011
    Posts
    6

    Post How to generate a repeating text sequence

    I'm struggling to create the VBA to achieve the following...

    Replace whatever text is in cells in a column with a repeated sequence of text values.

    For example:-

    Cell...
    x1 = "Text1"
    x2 = "Text2"
    x3 = "Text3"

    Then repeat...
    x4 = "Text1"
    x5 = "Text2"
    x6 = "Text3"

    Then repeat...
    x7 = "Text1"
    x8 = "Text2"
    x9 = "Text3"

    ... and repeat until the end of data in cell xn (a blank cell).

    Has anyone a clever piece of VBA code to achieve this please? Many thanks. F

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: How to generate a repeating text sequence

    Suppose you have data in column A and you want results in column B
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,514

    Re: How to generate a repeating text sequence

    Formula in Y1

    ="Text"&MOD(ROW(A1)-1,3)+1

    Then copy down

    VBA
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    02-25-2019
    Location
    Letchworth, Hertfordshire
    MS-Off Ver
    Excel for Mac 2011
    Posts
    6

    Re: How to generate a repeating text sequence

    Many thanks for your rapid response Yasser.

    Your routine looks nicely efficient. I should have been a little clearer however with what I am trying to achieve , which is...

    Cell...
    x1 = "Blue - Dark (287)"
    x2 = "Blue - Light (284"
    x3 = "Orange (021)"

    Then repeat...
    x4 = "Blue - Dark (287)"
    x5 = "Blue - Light (284"
    x6 = "Orange (021)"

    Then repeat...
    x7 = "Blue - Dark (287)"
    x8 = "Blue - Light (284"
    x9 = "Orange (021)"

    Many thanks if you can help further. F

  5. #5
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: How to generate a repeating text sequence

    Use this
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-25-2019
    Location
    Letchworth, Hertfordshire
    MS-Off Ver
    Excel for Mac 2011
    Posts
    6

    Re: How to generate a repeating text sequence

    That works brilliantly Yasser. Very many thanks. You are a star! ;-)) Regards, Frank

  7. #7
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: How to generate a repeating text sequence

    You're welcome. Glad I can offer some help
    Please mark the thread as solved

+ 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. [SOLVED] How to generate auto sequence number for repeating sets of array
    By rajatp in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-27-2018, 05:20 AM
  2. Repeating sequence, how?
    By pepijnkr in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 01-30-2017, 08:53 AM
  3. [SOLVED] repeating sequence
    By abhijit2610 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-21-2016, 11:12 AM
  4. Repeating sequence
    By HakeemJones in forum Excel General
    Replies: 9
    Last Post: 11-13-2014, 12:51 PM
  5. Autofill a pattern or repeating sequence
    By awcwa in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-03-2013, 12:04 PM
  6. Repeating a sequence
    By Slothook in forum Excel General
    Replies: 3
    Last Post: 10-28-2011, 04:05 PM
  7. [SOLVED] Repeating a sequence of numbers down a column
    By Nexan in forum Excel General
    Replies: 2
    Last Post: 03-04-2005, 02:06 PM

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