+ Reply to Thread
Results 1 to 4 of 4

VBA code for Dynamic range

  1. #1
    Registered User
    Join Date
    01-03-2011
    Location
    Bangalore, India
    MS-Off Ver
    MS Excel 2010
    Posts
    49

    VBA code for Dynamic range

    Hello,

    In my VBA, for a cell I am calling a formula. Let's say
    Range("B2").Formula="=SUM($C$2:$C$500)"

    But My last cell is not fixed. It keeps on Changing. Thus I want $C$500 also to change as per the number of rows in column C.
    Can i get any assistance on getting this dynamic range coded... I have given my entire syntax used in the code tag.
    Thanks!

    Please Login or Register  to view this content.
    Last edited by Srikanth H N; 03-03-2014 at 11:17 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: VBA code for Dynamic range

    Hi,

    To make the last row dynamic, change
    Please Login or Register  to view this content.
    to something like this:
    Please Login or Register  to view this content.
    I hope this helps

  3. #3
    Registered User
    Join Date
    01-03-2011
    Location
    Bangalore, India
    MS-Off Ver
    MS Excel 2010
    Posts
    49

    Re: VBA code for Dynamic range

    Thnak you ajryan... It's working...

  4. #4
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: VBA code for Dynamic range

    You're welcome

+ 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] Need help with Dynamic Range in my code.
    By moonsaga in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2014, 01:08 PM
  2. How can I fix the below code for establishing a dynamic range?
    By xcelnovice101 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2013, 03:16 PM
  3. How do i reference a dynamic cell range in VBA code
    By alice03 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-08-2013, 10:56 AM
  4. VBA Code - Autofill with a Dynamic Range
    By Jurij in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-24-2013, 02:27 AM
  5. VBA code for dynamic name range
    By weii in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-12-2007, 07:36 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