+ Reply to Thread
Results 1 to 4 of 4

Vlookup

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-31-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    204

    Vlookup

    Hi all, I have rather silly question.. I have 5 columns and my 3rd column is empty.. I use VLOOKUP and double click on the cell so it populates for all the info..However when I go to 4th column it will populate the 1st cell but will not populate all cells below when I double click on the box.. I was told it is because the 3rd column is all empty..

    Hope the above makes sense.. if not..can post an example..Is there a way around this?

    thanks so much!

    Danny

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

    Re: VLOOKUP question

    double click? why? i think you need to post an example.
    "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

  3. #3
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: VLOOKUP question

    When you double-click the lower right corner of a cell it acts like an automatic fill-down. This only works when there is data in the cells immediately to the left or right of the cells you're trying to auto-fill. If, for example, you had data in C1:C10 and C12:C20 and you entered a formula into D1. You could double-click the lower right corner of D1 and it would auto-fill the formula down to D10. It would stop there, because there is no value in D11. You would manually have to copy the formula to D12, and then you could double-click again to fill the rest of the way down to D20.

    This functionality cannot be altered that I'm aware of, but if you wanted you could create a macro to run via the DoubleClick event to fill down values/formulas.. only problem is how would the macro know when to stop? Would it always base the "last row to fill to" on two columns to the left? Seems like more work than necessary to just click on the lower right corner of D1 and drag your mouse downward to the bottom of your data (or select D1:D?? and use Fill -> Down).

  4. #4
    Forum Contributor
    Join Date
    08-31-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    204

    Re: Vlookup

    I am trying to modify it with below code but ran into a small problem with error '1004' - "Method 'Range' of object]_Global'failed'


    I have my data IDs begining column B14. I use VLOOKUP in columns C and D.
    Column E is empty
    I am using VLOOKUP in column F
    below is the code I modified. It is breaking on line:
    Range("F14").AutoFill Destination:=Range("F14:B" & lastrow)


       Range("F14").Select
    
        ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-4],'Data'!C[-3]:C[23],27,0)"
    
        Dim lastrow As Long
    
        lastrow = Range("B14" & Rows.Count).End(xlUp).Row
    
        Range("F14").AutoFill Destination:=Range("F14:B" & lastrow)
    
        Range("F14").Select


    I am hoping that it will autofill column F all the way down of column B..

    Any suggestions would be greatly appreciated!

    Thanks so much

+ 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