Results 1 to 2 of 2

Thread: VBA Code does not work with vlookup
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Apr 2013
    Location
    UK
    Posts
    219
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default VBA Code does not work with vlookup

    Hi
    I have the below code that works when the users keeps entering a 1 under column B , say row 2, which then keeps adding 1 Under column C, say row 2. But it does not work if I have a vlookup in column B row 2.
    Can anyone tell me how to make this code work when column B as a vlookup formula
    Private Sub Worksheet_Change(ByVal Target As Range)




    If Not Application.Intersect(Target, Columns(2)) Is Nothing Then
    If Target = 1 Then Target.Offset(0, 1).Value = Target.Offset(0, 1).Value + 1
    End If


    End Sub


    Thank you
    0 0
     

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,190
    Post Thanks / Like
    Mentioned
    470 Post(s)
    Tagged
    47 Thread(s)

    Default Re: VBA Code does not work with vlookup

    Duplicate https://www.mrexcel.com/forum/excel-...ml#post5319372

    Please do not post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread.
    Per forum rules, posts of a duplicate nature will be locked or deleted (rule 12 here: Forum Rules).

    If you do not receive a response, you can "bump" it by replying to it again, though we advise you to wait 24 hours before doing and not to bump a thread more than once a day.

    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10
    0 0
     

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •