+ Reply to Thread
Results 1 to 5 of 5

Using search but returning the formatting/hyperlink of the original cell

  1. #1
    Registered User
    Join Date
    09-29-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    73

    Using search but returning the formatting/hyperlink of the original cell

    Hi there

    I have a spreadsheet which has a basic search function on the first tab. However, when it returns data (which is on the second tab) it does not include the hyperlink which appears in the original. I wondered if there was a way to alter the code to display the original cell as it appears (preferably with formatting too but this is not essential).

    I've attached a demo version which may explain more clearly what I am looking for.

    Many thanks.
    Attached Files Attached Files

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Using search but returning the formatting/hyperlink of the original cell

    I did it with VB.


    I put this code on Sheet1:

    Please Login or Register  to view this content.
    And then I put this code in Module1:

    Please Login or Register  to view this content.
    To use Visual Basic, go into Excel, hit Alt+F11. This brings up the editor. Double-click Sheet1 and paste the first block of code there, which is a Worksheet Change event that fires off automatically when the named cell changes. It calls the second piece of code.

    Go to Insert -> Module and paste the 2nd chunk of code there. You can update the references as needed in either piece of code.

    The code is looking at B column of your list, checking to make sure it's not "" and then copying the relevant link to the search tab. The list clears itself at the beginning of each copy.
    Attached Files Attached Files
    Last edited by daffodil11; 02-20-2014 at 07:22 PM.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Using search but returning the formatting/hyperlink of the original cell

    lookups return text/value answers, they do not (generally) return formatting of formulas/links. I suggest that you create a formula to put in the link you want
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    09-29-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Using search but returning the formatting/hyperlink of the original cell

    Thanks daffodil11. I thought I might have to use VBA and your solution worked perfectly. Thanks.

  5. #5
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Using search but returning the formatting/hyperlink of the original cell

    Cool beans, glad I was able to help out.

+ 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. Replies: 2
    Last Post: 02-18-2012, 05:52 PM
  2. Retaining original formatting on cell being copied to
    By Alkemac in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-15-2009, 04:59 AM
  3. [SOLVED] Can I keep the original cell formatting when using FILL?
    By Alyssa in forum Excel General
    Replies: 2
    Last Post: 02-09-2006, 10:10 PM
  4. [SOLVED] Trouble returning to original active cell
    By Giznawz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-03-2005, 09:05 AM
  5. [SOLVED] Trouble turning off sheet updating and returning to original active cell
    By Giznawz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-01-2005, 06:05 PM

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