How to trim the display text of hyperlink in Excel -


i have cells contain hyperlinks. hyperlinks have leading blanks. if use trim, result returned text, not hyperlink.

is there worksheet function (not vba) can remove leading blanks , retain functionality of hyperlink?

example: ____link1text (where ___ blanks , link1text hyperlink in cell).

thank you.

you can try:

=hyperlink(trim(a1)) 

however, if link1text (without leading spaces) not actual url or full file path, excel formula not work. you'll need vba routine extract actual hyperlink address. if case, try udf (user defined function):

function gethyperlink(rg range) string     gethyperlink = rg.hyperlinks(1).address end function 

and use formula in cell:

=hyperlink(gethyperlink(a1),trim(a1)) 

Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -