Macro or function to copy cell B to multiple rows and then populate cell A2 onwards

avaris79

New Member
Joined
Dec 23, 2020
Messages
6
Office Version
  1. 2016
Platform
  1. Windows
Hi All,

I am new to this forum and excel macro.
I have data in column A where it is a single value & in column B where it is multiple values separated by ";".
Is there a way, using macro or function, to convert column B to multiple rows, then copy values from A1 to A+n onwards? Refer to my attached pictures for reference.
Thank you.
 

Attachments

  • Source.jpg
    Source.jpg
    17.1 KB · Views: 13
  • Target.jpg
    Target.jpg
    19.2 KB · Views: 13
How about the Ubound(x) statement? In this case X = column B which is required to be split?
X is an array containing the split result of column B
So Ubound (x) number of element in the array X
Hope this clear the issue
 
Upvote 0

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
You are welcome and thank you for the feedback
Be happy
 
Upvote 0

Forum statistics

Threads
1,214,924
Messages
6,122,293
Members
449,077
Latest member
Rkmenon

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