+ Reply to Thread
Results 1 to 4 of 4

adding dynamic formula inside loop to insert into offset cell

  1. #1
    Registered User
    Join Date
    09-29-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    16

    adding dynamic formula inside loop to insert into offset cell

    Hi all,

    not sure if my tiutle made sense...

    but this is what I have

    ActiveCell.Offset(nRow, 1).Formula = "=sum(D" & nRow + 3 "+ H" & nRow + 3")"
    This sits inside a loop where nRow is increase by 1 each loop.

    I am looking to have the following output:

    C4: =sum(D4,H4)
    C5: =sum(D5,H5)

    etc...

    the syntax is throwing out an error... any ideas?

    Thanks a million
    smartphreak
    Last edited by smartphreak; 11-09-2011 at 02:56 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,377

    Re: adding dynamic formula inside loop to insert into offset cell

    Maybe

    Please Login or Register  to view this content.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: adding dynamic formula inside loop to insert into offset cell

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  4. #4
    Registered User
    Join Date
    09-29-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: adding dynamic formula inside loop to insert into offset cell

    Thanks....

    could not see the wood for the trees....

+ 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