Rows to Column - Macro

wardex

New Member
Joined
Sep 21, 2023
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi guys, can you help me. I need a macro for this problem. Thanks in advance! :)
 

Attachments

  • capture-20230921-141631.png
    capture-20230921-141631.png
    4.1 KB · Views: 19
  • capture-20230921-141643.png
    capture-20230921-141643.png
    4.8 KB · Views: 20
Here is a long winded formula to do the same:
Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAA
11abcd1abcdefghijkl
2efgh2aabbccddeeffgghh
3ijkl3aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrsssttt
42aabbccdd
5eeffgghh
63aaabbbcccddd
7eeefffggghhh
8iiijjjkkklll
9mmmnnnoooppp
10qqqrrrsssttt
Sheet1
Cell Formulas
RangeFormula
G1:AA3G1=LET( r, A1:E10, s, SCAN(1,INDEX(r,,1),LAMBDA(a,x,IF(x="",a,x))), m, BYROW(UNIQUE(s),LAMBDA(x,TEXTJOIN(",",,FILTER(DROP(r,,1),s=x)))), c, MAX(BYROW(m,LAMBDA(x,LEN(x)-LEN(SUBSTITUTE(x,",",""))+1))), xml, "<t><s>" & SUBSTITUTE(m,",","</s><s>") & "</s></t>", HSTACK(UNIQUE(s),IFERROR(FILTERXML(xml,"//s[" & SEQUENCE(,c) & "]"),"")) )
Dynamic array formulas.
 
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hi sir ZOT hoping you're still there.

Regarding with the code which you wrote, can you help me modify a little bit.

Actually it was perfect code that I need but I encountered error if a cells in column A contains text / letters, there will be an error prompting please see attached.

Thanks
 

Attachments

  • 3.jpg
    3.jpg
    46.6 KB · Views: 4
  • 1.jpg
    1.jpg
    86.2 KB · Views: 3
  • 2.jpg
    2.jpg
    101.4 KB · Views: 4
  • 4.jpg
    4.jpg
    95.5 KB · Views: 4
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top