Can this UDF changed to Rows instead of Colomns

Please_H

Board Regular
Joined
Apr 16, 2017
Messages
181
Office Version
  1. 2019
Platform
  1. Windows
Hi guys,

To break-down addresses this is the UDF I have been using, Can someone be kind enough to change its feature to break it down to rows instead of breaking it down to Colomns?

Thanks a lot,

Code:
Function SplitValues(a As String, b As String)
  SplitValues = Split(b & String(Application.Caller.Count, a), a)
End Function
 
Are you thinking directly via code or maybe using a UDF ?
 
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
As direct via code then...
Code:
Sub Example_Split()


Splt = Split("one,two,three,four", ",")
'in this case it is obvious that the string splits into 4 elements


'if need to test the resulting elements eg to run a loop then
u = UBound(Splt)  ' upper bound of the array.
'u = 3 here 4 array elements 0 to 3


'asign individual elements
Range("B2") = Splt(0)
Range("D6") = Splt(1)
Range("C2") = Splt(2)
Range("D3") = Splt(3)
Range("E3") = Splt(u)    'u = 3 so same string as line above (4 elements 0 to 3)


'assign whole to range
Range("A7:D7") = Splt


'reverse of split is join eg
Range("B4") = Join(Splt, "***")


End Sub
 
Upvote 0

Forum statistics

Threads
1,215,425
Messages
6,124,826
Members
449,190
Latest member
rscraig11

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