Textsplit & Concatenate from one column to another / multiple rows.

RoosterBull

New Member
Joined
Dec 1, 2024
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hello all that read this :)
I am trying to write a VBA code but without any success, and hoping that a good samaritan out there can help.
I have many strings of text, that within are divided by a "#" in column V / multiple rows. The end result that I am looking for it that each string of text be placed in Column F - Respective row, but with the text in sort of bullet form.
I have managed to do a code with VBA......albeit copying a recorded VBA but any cell in Column V that contains no text then produces a "#VALUE!" that I dont want.
The text in Row1 must be unaffected as it is static titles.
Very difficult to describe with words, so I have attached an example of what I have to Start and what the final objective is.
Please help if you can, it will be most appreciated.
Start data.JPG
Final objective.JPG
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
VBA code.
VBA Code:
Sub FillColumnF()
Dim Lr&, T&
Dim A, M
Lr = Range("V" & Rows.Count).End(xlUp).Row
A = Range("V2:V" & Lr)
ReDim R(1 To UBound(A, 1), 1 To 1)
For T = 1 To UBound(A, 1)
If A(T, 1) <> "" Then
M = Split(A(T, 1), "#")
R(T, 1) = Join(M, Chr(10))
M = ""
End If
Next T
Range("F2").Resize(UBound(A, 1), 1) = R
End Sub
 
Upvote 0
Solution
Hi Kvsrinivasamurthy, and thank you very much for your time in helping. Your code works perfectly for my application. Thank you
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,136
Members
452,890
Latest member
Nikhil Ramesh

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