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: 18
  • capture-20230921-141643.png
    capture-20230921-141643.png
    4.8 KB · Views: 18
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

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
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: 3
  • 1.jpg
    1.jpg
    86.2 KB · Views: 3
  • 2.jpg
    2.jpg
    101.4 KB · Views: 3
  • 4.jpg
    4.jpg
    95.5 KB · Views: 3
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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