1. Welcome to Chandoo.org Forums. Short message for you

    Hi Guest,

    Thanks for joining Chandoo.org forums. We are here to make you awesome in Excel. Before you post your first question, please read this short introduction guide. When posting or responding to questions please remember our values at Chandoo.org are: Humility, Passion, Fun, Awesomeness, Simplicity, Sharing Remember that we have people here for whom English is not there first language and we need to allow for this in our dealings.

    Yours,
    Chandoo
  2. Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  3. When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macros for Vloolup in excle

Discussion in 'VBA Macros' started by Harsha_1804, Jun 17, 2017.

  1. Harsha_1804

    Harsha_1804 New Member

    Messages:
    1
    HI ,

    I tried using recording macros but result was not correct (code is below) , and when i add additional data to same sheet it wont apply formula to the extra added data ,while
    applying manual v-lookup to the same date i am getting correct data,



    1-My manual Vlookup formula
    =VLOOKUP($B:$B,'Order DATA'!$B:$E,4,0)

    upload_2017-6-17_13-40-45.png


    2- VAB Record

    Code (vb):
    Sub VLOOKUP_CEK()
    '
    ' VLOOKUP_CEK Macro
    '

    '
       ActiveCell.FormulaR1C1 = "=VLOOKUP(C2,'Order DATA'!C2:C5,4,0)"
        Range("E2").Select
        ActiveCell.FormulaR1C1 = "=VLOOKUP(C2,'Order DATA'!C2:C6,5,0)"
        Range("F2").Select
        ActiveCell.FormulaR1C1 = "=VLOOKUP(C3,'Order DATA'!C3:C5,3,0)"
        Range("G2").Select
        ActiveCell.FormulaR1C1 = "=VLOOKUP(C3,'Order DATA'!C3:C6,4,0)"
        Range("E3").Select
        Selection.End(xlDown).Select
        Range("C1048576").Select
        Selection.End(xlUp).Select
        Range("D2180:G2180").Select
        Range(Selection, Selection.End(xlUp)).Select
        Range(Selection, Selection.End(xlUp)).Select
        Range("D2:G2180").Select
        Range("D2180").Activate
        Selection.FillDown
        Range("D2").Select
    End Sub

    Attached Files:

    Last edited by a moderator: Jun 17, 2017
  2. vletm

    vletm Well-Known Member

    Messages:
    2,716
    Harsha_1804
    If Your 'sample file' is like below ...
    Screen Shot 2017-06-17 at 19.23.02.png
    What would be connection with Your case?
    What would that VLOOKUP_CEK should do?
    ... What would be Your case?
    Chirag R Raval likes this.

Share This Page