+ Reply to Thread
Results 1 to 8 of 8

series fill vba

  1. #1
    Forum Contributor
    Join Date
    04-29-2012
    Location
    nuneaton, England
    MS-Off Ver
    Office 365
    Posts
    369

    series fill vba

    within my vba, i have a line that inserts a formula into a cell which looks like this and works

    PHP Code: 
    Range("b25").Formula "=IF('Times!f29="""","""",'Times'!f29)" 
    my question is,

    instead of adding another line with similar formula, how would i do a fill series horizontally without writing it as follows

    PHP Code: 

    Range
    ("b25").Formula "=IF('Times!f29="""","""",'Times'!f29)"
    Range("c25").Formula "=IF('Times!g29="""","""",'Times'!g29)"
    Range("d25").Formula "=IF('Times!h29="""","""",'Times'!h29)" 
    i was thinking about adding a col, row and a loop to do a column=column+1 so it keeps going until reaching cell at25 but dont know how to write it and will keep trying until one of you brainy people tell me.. lol

    please note the f29 value also increments

  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,464

    Re: series fill vba

    Please Login or Register  to view this content.

    Regards, TMS
    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 Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: series fill vba

    Doesn't this work?
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    04-29-2012
    Location
    nuneaton, England
    MS-Off Ver
    Office 365
    Posts
    369

    Re: series fill vba

    the f29 value also changes incrementally

    ie
    b25=f29
    c25=g29
    d25=h29

    etc to

    at25=ax29

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: series fill vba

    F29 will increment with the posted code.

  6. #6
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: series fill vba

    That is what this code does.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  7. #7
    Forum Contributor
    Join Date
    04-29-2012
    Location
    nuneaton, England
    MS-Off Ver
    Office 365
    Posts
    369

    Re: series fill vba

    that worked ok... i didnt think about it that way .. sorry for my idiocy. i thought the code only incremented the first part... the b25


    i did the hard work then...lol

    thank you both
    Last edited by wayneg; 03-04-2014 at 09:13 AM.

  8. #8
    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,464

    Re: series fill vba

    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. fill series
    By ahrob in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-03-2013, 07:37 AM
  2. need to fill series. three different series adjacent to each other
    By ajainwa in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-07-2013, 04:48 PM
  3. Replies: 1
    Last Post: 01-29-2006, 08:55 AM
  4. [SOLVED] Fill series
    By Stephen Esrati in forum Excel General
    Replies: 1
    Last Post: 12-29-2005, 08:00 PM
  5. [SOLVED] Filling in a Date Series using the Fill | Series menu command
    By Bob C in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-01-2005, 08:06 PM

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