Advanced Transpose and/or grouping help

JustinW1

New Member
Joined
Mar 24, 2020
Messages
2
Office Version
  1. 365
Platform
  1. MacOS
I need help, I'm on a MAC and don't know how to use VBA's. Previously I would have used MS Access, but.... Mac!

Here is what my data looks like:

PDP URLIMAGE URLIMAGE ALT TEXT
abc.com/page1.htmlabc.com/images/banana.jpgBanana
abc.com/page1.htmlabc.com/images/apple.jpgApple
abc.com/page1.htmlabc.com/images/pair.jpgPair
abc.com/page2.htmlabc.com/images/orange.jpgOrange
abc.com/page3.htmlabc.com/images/pineapple.jpgPineapple
abc.com/page3.htmlabc.com/images/melon.jpgMelon

What I'm trying to achieve is:
PDP URLIMAGE 1 URLIMAGE 2 ALT TEXTIMAGE 2 URLIMAGE 2 ALT TEXTIMAGE 3 URLIMAGE 3 ALT TEXT
abc.com/page1.htmlabc.com/images/banana.jpgBananaabc.com/images/apple.jpgAppleabc.com/images/pair.jpgPair
abc.com/page2.htmlabc.com/images/orange.jpgOrange
abc.com/page3.htmlabc.com/images/pineapple.jpgPineappleabc.com/images/melon.jpgMelon

Hopefully you'll see what I'm trying to achieve.

Apologies if this is straightforward, I'm pretty good at basic spreadsheets but this has stumped me, and my Google searches.

Next fruit salad is on me ;)
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
try this UDF:
VBA Code:
Public Function abc(Target As Range, Optional separator As String = "/") As String
    abc = ""
    Dim str As String, i As Long
    On Error Resume Next
    str = Target.Text
    If Len(str) = 0 Then Exit Function
    i = InStrRev(str, separator, , 1)
    str = Right(str, Len(str) - i)
    i = InStrRev(str, ".", , 1)
    str = Left(str, i - 1)
    abc = WorksheetFunction.Proper(str)
End Function
 
Upvote 0
try this UDF:
VBA Code:
Public Function abc(Target As Range, Optional separator As String = "/") As String
    abc = ""
    Dim str As String, i As Long
    On Error Resume Next
    str = Target.Text
    If Len(str) = 0 Then Exit Function
    i = InStrRev(str, separator, , 1)
    str = Right(str, Len(str) - i)
    i = InStrRev(str, ".", , 1)
    str = Left(str, i - 1)
    abc = WorksheetFunction.Proper(str)
End Function

Thanks for the helo bobsan42 but I can't get this to work for me. When I run the macro, nothing happens.
 
Upvote 0
this is not a macro to run - it is a Function.
Place the code in a code module in your workbook, then use it as formula in a cell: = abc(A1)
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,151
Members
453,021
Latest member
Justyna P

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