vba - How to split a row into columns for every three columns in excel? -


In Excel, how do I split a line into a set of columns? In A1: G1, the data should be in the first line, then A1: C1 will be similar to the first row, D1: G1 should be from the end of the first line. This should continue till the data in the first row is limited to G1. .

I have data like

  ABCDE ... AE Air Force AG 1 AB 2013/01/12 2013/02/23 233 2013/02/24 2013 / 03/11 500 2 CD 2013/01/12 2013/02/23 233 2013/02/24 2013/03/11 343. I need this:  
   ABCDE 1AB 2013/01/12 2013/02/23 233. 1 AB 2013/02/24 2013/03/11 500 2 CD 2013/01/12 2013/02/23 233. 2 cd 2013/02/24 2013/03/11 343.   

How can this be done in Excel, I tried to write a VB script, but it did not go anywhere. Nobody can help me with this.

OK, so it seems that you have two cells with a static id and the name is three There is a series of cells that show a pattern of date , date , number . You want to take everything on the right side of the first two cells, repeating the two rows. It should do.

sub-split_and_stack () as long as slow, long time, as long as the LC, LR, as long as dim ws1 worksheet, set ws2 worksheet As ws1 = ActiveSheet Sheet. : = Sheets (Sheets.Count) Set ws2 = Sheets (Sheets.Count) ws2.Cells (1, 1) .Resize (1, 5) = array ("id", "name", "start", "end "," Number ") ws1 lr =. With (rows.count, 1). End (XLEEP) .ro lc = .sec (1, column.account). End (XLTOLET) For column R = 1 LR for C = 3 for LC phase 3 ws2.Cells (rows.Count, 1). End (XLEP). Offset (1, 0). Resize (1, 2) = _ (R, 1). Repeat (1, 2). Value ws2.Cells (rows. Count, 1). End (XLEP). Offset (0, 2). Resize (1, 3) = _ (R.C.). Resize (1, 3). Price Next C Next With R & End And End Sub

The following image can not show the correct date but you should get general knowledge. It is always a good idea to not provide such a vague date that is written in the form of mm / dd / yy or dd / mm / yy while supplying sample data May be.

One Enter image details here

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -