Results 1 to 4 of 4

Thread: Order multiple texts in "row.cells" in columns

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    Hello vbadumb
    excelfox is a place to further the knowledge of excel: it is for people to get excel help from other people.
    So tell us a bit more about what you are trying to do and why. That might help us to give the best help
    _..Alternatively, if you just want to post anonymous question, best try one of the larger forums in future , like
    mrexcel.com
    or
    excelforum.com




    Here is what you gave as sample data, and wanted results, and macro results: https://excelfox.com/forum/showthrea...ll=1#post15293
    https://excelfox.com/forum/showthrea...ll=1#post15293

    Here is a macro to get you started https://excelfox.com/forum/showthrea...ll=1#post15294 .

    Here is a brief summary of what is going on in the macro that I have done for you
    I capture your data from the first worksheet into an array, arrIn() = WsIn.Range("B1:F5").Value2
    I loop through the header columns, For Clm = 1 To 5 Step 1 , ( and do nothing if any column headers are empty
    If I have a header, then I note that in variable Itms
    I then go down the data rows, For RwDta = 2 To 5 Step 1
    If I don’t have any data in a row , I do nothing. Otherwise I try to fill a string, strOutB , with as much data as is in a cell. I continually add to that string. I separate that data with a line feed ( vbCr & vbLf ) . I could use any character , ( provided its one that doesn’t appear in any data ) , but the line feed is convenient because I could also view my data in a message box or in the immediate window.
    In each loop, I can determine the number of times I need to have the header by the number of elements I get from an array made from strOutB split by the vbCr & vbLf
    The header data wanted in column A of the output goes into a similar string, strOutA


    Please let us know how you get on with it.


    Alan
    Last edited by DocAElstein; 02-12-2021 at 11:10 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

Similar Threads

  1. Replies: 3
    Last Post: 11-17-2019, 11:08 PM
  2. VBA Versions of my "Get Field" and "Get Reverse Field" formulas
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 4
    Last Post: 06-02-2017, 06:15 PM
  3. Replies: 1
    Last Post: 02-10-2015, 09:41 AM
  4. Replies: 4
    Last Post: 09-09-2013, 05:13 PM
  5. Ordinal Suffix (i.e., "st", "nd", "rd" and "th")
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 0
    Last Post: 03-20-2012, 03:46 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •