+ Reply to Thread
Results 1 to 10 of 10

Using If and Vlook function with VBA

  1. #1
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Question Using If and Vlook function with VBA

    Hi,

    Is is possible to achieve it by having macro.

    statement :
    If any cell in Column A match any cell in column G then corresponding cells in column B will be equal to corresponding cells in column H??


    Please Login or Register  to view this content.
    Many help please
    regards

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,604

    Re: Using If and Vlook function with VBA

    Try

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Using If and Vlook function with VBA

    Hi Zbor,
    Great work. I have clicked * to thank you.

    However instead of filling up formule , can we have macro which will do the needful.
    Just a thought
    Regards

  4. #4
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Using If and Vlook function with VBA

    With this I can apply this to the whole sheet where corresponding cells in any column will have the same effect.

    A B C D E F

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,604

    Re: Using If and Vlook function with VBA

    Can you upload example of what you trying to do?

  6. #6
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Using If and Vlook function with VBA

    Hi
    Apology for a late reply as I was away on work.
    I have attached the sample file.
    Many thanks for your help
    Regards
    Attached Files Attached Files

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,604

    Re: Using If and Vlook function with VBA

    Right click on sheet name -> View Code
    Then paste this code:
    Please Login or Register  to view this content.
    If you want to change value within a same cell use:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Using If and Vlook function with VBA

    Hi
    Thanks a lot . I am currently having issues with my excel and the PC.
    I will resolve and then check your solution.
    Then will get back to you.
    I really appreciate your help and I am sure it will work.
    Thanks Pal
    Regards

  9. #9
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Using If and Vlook function with VBA

    Hi
    I have tried the codes and every time in try them the excel stops working.
    I uninstalled MS office and reinstalled it with all MS updates. It still is not working .
    It does not happen with other excel files and any of other change events.
    I think we need to look at the code carefully and redefine it if possible
    Sorry
    regards

  10. #10
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Using If and Vlook function with VBA

    Hi
    There something in this code which closes excel or stalls it.
    I have tried to use it and hence I have decided not to proceed further on this for now.
    Thanks any way.
    regards

+ 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