Closed Thread
Results 1 to 8 of 8

looping formulas heeellllpppp!!!!!!!

  1. #1
    Registered User
    Join Date
    03-06-2010
    Location
    essex, england
    MS-Off Ver
    Excel 2003
    Posts
    23

    looping formulas heeellllpppp!!!!!!!

    hi all,

    so heres my problem,

    im trying to loop some code using vba.
    i have a sheet running which displays my sales orders and i need to know by clicking a button which sales orders are behind schedule
    in cell a2 i have the formula = today()
    the dates for my sales orders are in cells h7 : h238
    and i need the results to be displayed in cells L7 : L238
    this is what i need to happen, if h7 < a2 + 3 then display "dates behind schedule" in L7
    if h8 < a2 + 3 then display "dates behind schedule" in L8
    and so on untill row 238

    ok so here is what i have so far: sub blah blah ()
    if h7 < a2+3 then
    range ("L7") = dates behind schedule
    endif
    end sub

    this works but will only apply the results to cell L7
    i also dont want the formula in the cells just the results

    ps i have basic experience with excel so i know how to insert and apply code to a button.

    please help this has been driving me mad for weeks now

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,651

    Re: looping formulas heeellllpppp!!!!!!!

    Hi, Try this:-
    Please Login or Register  to view this content.
    Regards Mick

  3. #3
    Registered User
    Join Date
    03-06-2010
    Location
    essex, england
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: looping formulas heeellllpppp!!!!!!!

    hi mick,
    thanks for your reply all seems to work but i need the result to be in cell L7, at the moment it displays in i7

    thanks pete

  4. #4
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: looping formulas heeellllpppp!!!!!!!

    cant see mick about but
    change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    03-06-2010
    Location
    essex, england
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: looping formulas heeellllpppp!!!!!!!

    worked like a charm thanks for your help

  6. #6
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,651

    Re: looping formulas heeellllpppp!!!!!!!

    Hi, If you;ve not changes both "If" & "Else" , alter as below.
    The idea is that each time you run the code the old data is removed.
    Please Login or Register  to view this content.
    Regards Mick

  7. #7
    Registered User
    Join Date
    03-06-2010
    Location
    essex, england
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: looping formulas heeellllpppp!!!!!!!

    excellent its perfect thanks again

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202

    Re: looping formulas heeellllpppp!!!!!!!

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

Closed 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