+ Reply to Thread
Results 1 to 7 of 7

make vba code formula dynamic

  1. #1
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    make vba code formula dynamic

    I have workbook with sheets CustomerA and Report .



    So far I have 915 rows when applying code but if no of rows in red are dynamic that is it can can be 100 or 500 or 20000 instead of 915 as e.g .

    How to make column J,K,L and W and AD dynamic instead of static(in red) with actual code.

    The criteria to last row of data is column C

    Row 1 are headers




    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Usually at work, in the UK
    MS-Off Ver
    Excel 2010
    Posts
    639

    Re: make vba code formula dynamic

    You will have to do a row count and use the value instead of 915

  3. #3
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: make vba code formula dynamic

    Please Login or Register  to view this content.
    Last edited by Bernie Deitrick; 10-30-2018 at 12:55 PM.
    Bernie Deitrick
    Excel MVP 2000-2010

  4. #4
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: make vba code formula dynamic

    Edit: answered, long delay on my internet for some reason
    Last edited by nigelog; 10-30-2018 at 10:53 AM.

  5. #5
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    Re: make vba code formula dynamic

    Hi Bernie

    Tested code, got message pop up compile error End If without block if .




    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: make vba code formula dynamic

    Sorry - I had a brain freezer. Change 'If' to 'With' as in

    End With

    not

    End If

  7. #7
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,086

    Re: make vba code formula dynamic

    Perfect Bernie Thank you a lot

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] assistance to make a vba code run on a dynamic range
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-16-2017, 12:33 AM
  2. [SOLVED] How to amend VBA code to make it more dynamic?
    By The_Snook in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-11-2016, 06:30 PM
  3. [SOLVED] How to make the following code dynamic?
    By Rerock in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-19-2015, 03:55 PM
  4. Simply VBA code and make it dynamic
    By Rusty315 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-09-2014, 02:49 AM
  5. I Want to know how I can make this formula into vba code for dynamic cell address
    By dgdgdg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2013, 02:41 PM
  6. [SOLVED] I Want to know how I can make this formula into vba code for dynamic cell address
    By dgdgdg in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-06-2013, 12:54 PM
  7. [SOLVED] Make Static code Dynamic
    By Rick_Stanich in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-05-2012, 11:09 AM

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