+ Reply to Thread
Results 1 to 10 of 10

VLOOKUP

Hybrid View

  1. #1
    Dave O
    Guest

    Re: VLOOKUP

    Do you have the Analysis Toolpak installed?


  2. #2
    Dave O
    Guest

    Re: VLOOKUP

    Your original post says
    Also, if I try =IF((B5=Temp!B7),"OK","Not OK") it comes up with 'Not
    OK'.

    Assuming this is a typo and the IF should read B5=Temp!B5, this
    suggests a formatting mismatch. If one is text and the other is
    numeric, it will pass your ascii char code test and still fail the
    VLOOKUP.


  3. #3
    Mike McLellan
    Guest

    Re: VLOOKUP

    Yes - it was a typo

    I've tried reformatting both ranges as text but it doesn't appear to make
    any difference

    "Dave O" wrote:

    > Your original post says
    > Also, if I try =IF((B5=Temp!B7),"OK","Not OK") it comes up with 'Not
    > OK'.
    >
    > Assuming this is a typo and the IF should read B5=Temp!B5, this
    > suggests a formatting mismatch. If one is text and the other is
    > numeric, it will pass your ascii char code test and still fail the
    > VLOOKUP.
    >
    >


  4. #4
    Dave O
    Guest

    Re: VLOOKUP

    Simply reformatting the range doesn't help unless you go into each
    cell, edit, and press Enter. This is a macro that will do that for
    you: please try this on a BACKUP copy of your file to avoid the
    possibility of data loss. Suppose you want to verify / convert that
    data in column D is text. At the bottom of column D, below the data in
    question, enter the word "stop" (no quotes) in a cell. Set your cell
    pointer at the top of column D and run this macro. It temporarily
    stores the entry in memory, clears the cell, formats the cell as text,
    and rewrites the entry into that cell with no leading or trailing
    spaces.

    Remember- run this on a BACKUP copy of your file! This little macro
    has worked properly for me countless times- don't be the first to
    figure out it creates problems on your setup.

    Sub TrueVal()
    With Application
    .Calculation = xlManual
    .MaxChange = 0.001
    End With
    ActiveWorkbook.PrecisionAsDisplayed = False

    Dim TrueVal as String

    Do Until ActiveCell.Value = "stop"
    TrueVal = Trim(ActiveCell.Value)
    ActiveCell.Value = ""
    Selection.NumberFormat = "@" 'set format to Text
    ActiveCell.Value = Trim(TrueVal)
    ActiveCell.Offset(1, 0).Select
    Loop

    With Application
    .Calculation = xlAutomatic
    .MaxChange = 0.001
    End With
    ActiveWorkbook.PrecisionAsDisplayed = False

    Calculate
    End Sub


  5. #5
    JBS
    Guest

    Re: VLOOKUP

    Thank you so much for this macro. I have been struggling with this for days.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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