Extracting Multiple Strings in a Cell Based on Criteria

ktkelly_1

New Member
Joined
Jun 13, 2019
Messages
17
Hi! So I have a situation, I am currently trying to pull out hyperlinks (that are not linked so they are just text in a cell) from multiple cells that link to a website called jama. They are all contained in a column N and there are some that have one link and then another that contains multiple for example:


"Random sting of text that is supposed to represent a message here:



[https://jama.prz.ife.eu-west-1.aws.thales/pages/vie*

+Related Requirements:+

[https://jama.prz.ife.eu-wes*

[https://jama.prz*

[https://jama.prz.ife.eu-west-1.aws*"



So currently I am trying to brain storm a code that could extract each of these hyperlinks based on the string "jama" and if there are multiple then add a row and put the next one in that corresponding cell under the first cell... Like so:

from

[TABLE="class: k-table, width: 979"]
<tbody>[TR]
[TD]ID[/TD]
[TD] [https://jama.prz.ife.eu-west-1.aws.thales/pages/vie*

+Related Requirements:+

[https://jama.prz.ife.eu-wes*

[https://jama.prz*

[https://jama.prz.ife.eu-west-1.aws*"[/TD]
[/TR]
</tbody>[/TABLE]


to



[TABLE="class: k-table, width: 979"]
<tbody>[TR]
[TD]ID[/TD]
[TD] https://jama.prz.ife.eu-west-1.aws.thales/pages/vie*[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]https://jama.prz.ife.eu-wes*[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]https://jama.prz*[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]https://jama.prz.ife.eu-west-1.aws*"[/TD]
[/TR]
</tbody>[/TABLE]




I was reading up on this and someone had written a code (below) however I am having trouble using it. Anything Helps, let me know if I need to explain further



Function MultipleLookupNoRept(Lookupvalue As String, LookupRange As Range, ColumnNumber As Integer)

Dim i As Long

Dim Result As String

For i = 1 To LookupRange.Columns(1).Cells.Count

If LookupRange.Cells(i, 1) = Lookupvalue Then

For j = 1 To i - 1

If LookupRange.Cells(j, 1) = Lookupvalue Then

If LookupRange.Cells(j, ColumnNumber) = LookupRange.Cells(i, ColumnNumber) Then

GoTo Skip

End If

End If

Next j

Result = Result & " " & LookupRange.Cells(i, ColumnNumber) & ","

Skip:

End If

Next i

MultipleLookupNoRept = Left(Result, Len(Result) - 1)

End Function

also posted on Microsoft Community: https://answers.microsoft.com/en-us...-f750-44b4-b2d9-26e66bc33d9f?tm=1562793663806
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,624
Latest member
gregg777

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