Automatically change hyperlink

superfb

Active Member
Joined
Oct 5, 2011
Messages
255
Office Version
  1. 2007
Platform
  1. Windows
Hi,

I have a hyperlink I use and there is a cell I manually enter to put a client's names. As a result the hyperlink concatenates this to form the hyperlink.

However, the directory is going to be split from A-L and M - Z.

Is there a formula that can pick up the first letter of the client name? Then determine by a if what file directory should be used....
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
=IF(CODE(LEFT(A1,1))>76,"put then m to z code in here","else put the a to l code in here")

Assuming the name is in A1
 
Last edited:
Upvote 0
Thank you for this. But some folders have (b) or ($) is there a way to exclude this and find the first letter.....
 
Upvote 0
that works a treat, however,

i have an if formula that isnt working,

=if(f5= "",

IF(CODE(LEFT(E1,1))<=75,(HYPERLINK(H1&":"&"\HomeStart\Information"&""&"A-K"&$C$5,H1&":"&""\HomeStart\Information"&""&"A-K"&$C$5)),

IF(CODE(LEFT(E1,1))>75,(HYPERLINK(H1&":"&""\HomeStart\Information"&""&"L-Z"&$C$5,H1&":"&""\HomeStart\Information"&""&"L-Z"&$C$5)

if F5 isnt blank then use,

IF(CODE(LEFT(E1,1))<=75,(HYPERLINK(H1&":"&"\HomeStart\Information"&""&"A-K"&$C$5,H1&":"&""\HomeStart\Information"&""&"A-K"&$C$5&$d$5)),

IF(CODE(LEFT(E1,1))>75,(HYPERLINK(H1&":"&""\HomeStart\Information"&""&"L-Z"&$C$5,H1&":"&""\HomeStart\Information"&""&"L-Z"&$C$5&$d$5)
 
Upvote 0
you have got a number of redundant ampersands which is probably causing you an error:
Try something like this:
Code:
=IF(CODE(LEFT(E1,1))<=75,(HYPERLINK(H1&":\HomeStart\InformationA-K"&$C$5,H1&":\HomeStart\InformationA-K"&$C$5&$D$5)))
What I usually do in these circumstancers is take the "=" sign out of the equation so the VBA just write text into the cell, then add the equals sign in manually and excel will show you where the error is.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,160
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