Great - thanks! That got it to work, but it sadly only copies the URL instead of 'unwrapping' it - I guess this is because the cells in column H contain a formula that outputs the URL.
An example - this is the formula in cell H9:
Formula:
=IFERROR(TRIM(CLEAN(MID(RawData!B2,SEARCH(TRIM(CLEAN(VLOOKUP(D9,Lookups!$C$208:$H$296,6,FALSE))), RawData!B2)+LEN(TRIM(CLEAN(VLOOKUP(D9,Lookups!$C$208:$H$296,6,FALSE))))+2,SEARCH(">",RawData!B2,SEARCH(TRIM(CLEAN(VLOOKUP(D9,Lookups!$C$208:$H$296,6,FALSE))),RawData!B2)+2)-SEARCH(TRIM(CLEAN(VLOOKUP(D9,Lookups!$C$208:$H$296,6,FALSE))),RawData!B2)-LEN(TRIM(CLEAN(VLOOKUP(D9,Lookups!$C$208:$H$296,6,FALSE))))-2))),"-")
...it basically searches a large text document for a specific, shortened bitly link.
The output of this formula is "https://bit.ly/3b2vDXN".
If I apply the =unwrap(A1) formula on just the URL, this works, however, it doesn't work on cell H9 as it contains the formula (I believe).
Do you think there's any workaround for that? I.e. let VBA pick the value of the cell rather than the formula to run this?
Also, some cells in my range H9: range are left empty as the IFERROR formula kicks in. The script seems to stop when there is an empty cell so I changed the output of the formula to be "-" instead of a blank so the script continues to run, but not sure if that would throw an error now as "-" is not a valid URL?
Thanks so much for the help - appreciate it!!
Bookmarks