+ Reply to Thread
Results 1 to 3 of 3

Hide hyperlink is cell next to it is blank

  1. #1
    Registered User
    Join Date
    05-03-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    23

    Hide hyperlink is cell next to it is blank

    Hello All,

    I need this to be done in VBA, not conditional formatting.

    I have 2 columns. Each cell in column A contains a number (20 rows). Then, each cell in column B contains a hyperlink. I would like to make it so that excel looks in each cell in Column A and hides the hyperlink in the cell contained in Column B (but only the cell in Column B on the same row). Is there some easy VBA code that would do this?

    Thanks all so much,
    Cedric

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Hide hyperlink is cell next to it is blank

    Hide? No. Delete? Yes. But then it's deleted and no way to get it back.

    Simpler, switch to using the HYPERLINK() formula in column B. With that, you can slip it inside an IF() statement that examines column A and provides NO hyperlink formula and thus no clickable hyperlink in B2 if A2 doesn't fit the criteria.

    For example, this formula provides a clickable hyperlink in B2:

    =HYPERLINK("http://www.google.com", "Click for Google")

    Now, the same formula but only if A2 isn't blank:

    =IF(A2<>"", HYPERLINK("http://www.google.com", "Click for Google"), "")
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    05-03-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Hide hyperlink is cell next to it is blank

    Awesome!!! thanks so much bud!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Hyperlink to next blank cell in a row
    By Andaw in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-26-2014, 10:42 AM
  2. Replies: 7
    Last Post: 06-02-2013, 07:23 PM
  3. Replies: 1
    Last Post: 02-23-2013, 05:18 AM
  4. [SOLVED] Need hyperlink in cell qnly if adjacent cell to left is blank...
    By egildone in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-27-2012, 03:52 PM
  5. [SOLVED] Hide hyperlink cell & replace with macros
    By Jose in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-14-2005, 05:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1