+ Reply to Thread
Results 1 to 10 of 10

Vlookup won't work b/c users copy/paste data and it changes the format of the locked cell

  1. #1
    Registered User
    Join Date
    11-19-2014
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    5

    Vlookup won't work b/c users copy/paste data and it changes the format of the locked cell

    I built an extensive worksheet for users to submit requests to our group. Based on the information input in one section a vlookup returns a value needed in another cell. This works fine if they just type in the data into the first cell; however, I've found that many are doing a copy/paste, which of course changes the format and causes the vlookup not to work. The worksheet is protected, but this of course does not protect format changes to a cell is the user copy/pastes. There should be a simple solution for this, but I cannot find it anywhere.

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Vlookup won't work b/c users copy/paste data and it changes the format of the locked c

    Hello and welcome to the forum,

    VLookup only looks at values, and I'm not sure how formatting affects the formula.
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    11-19-2014
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    5

    Re: Vlookup won't work b/c users copy/paste data and it changes the format of the locked c

    It affects the output if the data is formatted as number or as text.

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Vlookup won't work b/c users copy/paste data and it changes the format of the locked c

    Just put -- before the cell that contains the value being looked up to convert it to a number.

    For example:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-19-2014
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    5

    Re: Vlookup won't work b/c users copy/paste data and it changes the format of the locked c

    The data on the table is actually TEXT though b/c it is a query output.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Vlookup won't work b/c users copy/paste data and it changes the format of the locked c

    are you going to draw this out for as long as possible? perhaps giving some examples would help
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  7. #7
    Registered User
    Join Date
    11-19-2014
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    5

    Re: Vlookup won't work b/c users copy/paste data and it changes the format of the locked c

    So - here are more details.

    The lookup table has values that are all TEXT from the output of the query. The vlookup on another sheet refers to a cell that is TEXT or NUMBERS depending on if the user inputs the data by typing it in or sometimes they copy/paste the value. If they type the number in the cell, the vlookup works fine. However, if the copy/paste it will not work b/c this changes the format of the cell. I am sorry I don't know another way to explain this - what I would like to know is if there is a way to retain the original format of the cell even when the user inputs via the copy/paste method.

    Sorry, not trying to "draw this out as long as possible" - I didn't realize my explanation wasn't detailed enough.

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Vlookup won't work b/c users copy/paste data and it changes the format of the locked c

    have you tried it the other way
    =VLookup(A1&"", B:B, 1, false)

  9. #9
    Registered User
    Join Date
    11-19-2014
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    5

    Re: Vlookup won't work b/c users copy/paste data and it changes the format of the locked c

    Oh - that worked!!! Thanks so much!

  10. #10
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Vlookup won't work b/c users copy/paste data and it changes the format of the locked c

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Copy and paste locked cells, and have pasted cells retain LOCKED status.
    By stratloveslenny in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-16-2014, 03:05 PM
  2. Replies: 3
    Last Post: 04-12-2014, 04:47 AM
  3. Replies: 3
    Last Post: 02-21-2013, 12:48 AM
  4. Replies: 5
    Last Post: 08-20-2011, 04:14 PM
  5. Lock Cell Format - Allow copy and paste of data without format change
    By Chris12InKC in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-11-2006, 12:50 AM

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