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
    Post Thanks / Like
    0 Post(s)
    0 Thread(s)

    Default VBA Code does not work with vlookup

    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
    Fluff's Avatar
    Join Date
    Jun 2014
    Post Thanks / Like
    470 Post(s)
    47 Thread(s)

    Default Re: VBA Code does not work with vlookup


    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