+ Reply to Thread
Results 1 to 7 of 7

VLOOKUP Retun formated cell (keep source formatting)

  1. #1
    Registered User
    Join Date
    10-16-2012
    Location
    Amsterdam
    MS-Off Ver
    Excel 2016
    Posts
    25

    VLOOKUP Retun formated cell (keep source formatting)

    Hello All,

    I’m creating an Decision Tree. (see attached example)
    I made some progress but now I’m stuck.
    When I select a data calcification in Cell B5 (as confidential or restricted) it is grabbing information from the Sheet “Requirements” and filling this information in cell D5 and D6.
    The information form Cell D6 comes from “Requirements” Cell B24
    I would like to copy the information (including the Source format and color(s)) to Cell D6 on the “SaaS Questions” TAB.

    I can’t get it to work.
    The second with I have is that the Cell D6 keeps following the selection I made in B5.
    (When I hard copy the cell from “Requirements” B24 to “SaaS Questions” D6 , It will not change anymore when the selection is changed in cell B5 “SaaS Questions”

    So I’m looking for a VBA or a triggered Marco to keep playing with the selections in Column B but use the information from the “Requirements” tab Incl the formatting of the refence cell

    Emoes
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: VLOOKUP Retun formated cell (keep source formatting)

    Short story: VLOOKUP returns data only, not formatting.

    Long story: you can't do what you are asking with a function/formula. You may be able to do it with VBA but I doubt it would be a simple task. Having looked at your data, I suspect it would be an impossible task, given that the formatting is character based.

    Thinking out loud, it may be possible to use MATCH to locate the cell and copy and paste the whole cell to a new location. But, that said, I don't think a worksheet based UDF can do anything with formatting so it would probably need to be based on a Worksheet Change Event handler.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: VLOOKUP Retun formated cell (keep source formatting)

    Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your SAAS Questions sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Make a selection in B5.
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  4. #4
    Registered User
    Join Date
    10-16-2012
    Location
    Amsterdam
    MS-Off Ver
    Excel 2016
    Posts
    25

    Re: VLOOKUP Retun formated cell (keep source formatting)

    Hello Mumps1,

    This actually looking pretty good :-)
    Can I ask to add one extra thing?
    When Selecting "Confidential", "Restricted" this is copying the B24 (Requirements) to D6.
    Would it be possible to copy another cell also based on another selection?
    Something like:
    Private Sub Worksheet_Change(ByVal Target As Range)
    Please Login or Register  to view this content.
    You see I'm not a VBA person, but with this, extra option I can remove the formula from Cell D6 and based on the selection put in any Value with keeping the format.
    I hope I expressed my self clear enough.

    Emoes.

  5. #5
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: VLOOKUP Retun formated cell (keep source formatting)

    Try:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-16-2012
    Location
    Amsterdam
    MS-Off Ver
    Excel 2016
    Posts
    25

    Re: VLOOKUP Retun formated cell (keep source formatting)

    Hello Mumps1,

    This made me very happy.
    Thank you for your help.
    I have "add reputation"

    Thanks again.

    Emoes

  7. #7
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: VLOOKUP Retun formated cell (keep source formatting)

    You are very welcome and thanks for the rep.

+ 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: 1
    Last Post: 04-23-2020, 08:33 AM
  2. [SOLVED] vlookup retun blank help
    By MRozell in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-28-2017, 10:10 AM
  3. [SOLVED] Excel VBA Help: Keeping source formatting in VLOOKUP
    By Smores in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2017, 05:31 PM
  4. How do I take a cell formated as TIME and divide it by a cell formated as a number?
    By KellyHelpDeskManager in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-01-2015, 10:58 AM
  5. Vlookup or other tools to retun more than 1 match from 2 criteria
    By ggiorelli in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 03-17-2013, 06:23 PM
  6. Need VBA Code to "VLOOKUP" but keep source cell Formatting
    By flyyboy84 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-05-2012, 08:47 AM
  7. Vlookup to retun multiple values.
    By prasjohn in forum Excel General
    Replies: 2
    Last Post: 06-19-2010, 02:59 PM

Tags for this Thread

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