Results 1 to 6 of 6

VBA replace part of formula IF and VLOOKUP

Threaded View

  1. #1
    Registered User
    Join Date
    10-12-2016
    Location
    Nederland
    MS-Off Ver
    2013
    Posts
    3

    VBA replace part of formula IF and VLOOKUP

    Hi,

    I try to solve a VBA problem. I like to have a dropdown list with the choices of January to December in the worksheet "Net Sales-Budg-FC-PY". This worksheet links to 3 different worksheets with numbers of each month (jan-dec) in a different column (5-16). Each worksheet has the same column number from jan-dec.

    I like with VBA to change the formula on each cell Range("E5:S238") when I choice a different month.
    The difficulty is that the formula "Find and Replace" don't replace a part of a formula or the column number of the formula between semicolon ";". My formula look like this each cell Range("E5:S238"):

    - cell E5
    =IF(ISNB(VLOOKUP($A5;'Net Sales per brand'!$A$4:$AH$301;5;FALSE))=TRUE;0VLOOKUP($A5;'Net Sales per brand'!$A$4:$AH$301;5;FALSE))
    - cell E6
    =IF(ISNB(VLOOKUP($A6;'Net Sales per brand'!$A$4:$AH$301;5;FALSE))=TRUE;0;VLOOKUP($A6;'Net Sales per brand'!$A$4:$AH$301;5;FALSE))
    and so on...

    And
    - cell F5
    =IF(ISNB(VLOOKUP($A5;'Budget 2016'!$A$6:$AJ$393;5;FALSE))=TRUE;0;VLOOKUP($A5;'Budget 2016'!$A$6:$AJ$393;5;FALSE))
    - cell F6
    =IF(ISNB(VLOOKUP($A6;'Budget 2016'!$A$6:$AJ$393;5;FALSE))=TRUE;0;VLOOKUP($A6;'Budget 2016'!$A$6:$AJ$393;5;FALSE))
    and so on...

    Dropdown list:
    To choose February: January with the column ;5; have to be changed in February with column ;6;
    To choose March: February with the column ;6; have to be changed in March with column ;7;
    and so on...

    Can somebody help me with the wright formula? Thanks in advance!
    Last edited by Made; 10-12-2016 at 08:25 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Find & Replace Part of a Formula
    By kalebsmith10 in forum Excel General
    Replies: 2
    Last Post: 03-02-2016, 08:55 PM
  2. How to replace part of a formula with VBA
    By rockfrawg in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-17-2014, 05:23 PM
  3. Find and Replace part of formula using VBA
    By chococ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-14-2014, 01:26 PM
  4. Replace part of formula VBA
    By Testnntest in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-28-2013, 04:20 AM
  5. find and replace part of formula only
    By iceshimmer in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-06-2013, 06:51 AM
  6. How do I replace part of a formula using VBA?
    By Vaslo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-12-2012, 12:46 PM
  7. Q: DDE Link - Replace Part of the Formula
    By Reto Walker in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-14-2006, 12:15 PM

Tags for this Thread

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