+ Reply to Thread
Results 1 to 17 of 17

Loop Macro

  1. #1
    Registered User
    Join Date
    08-03-2017
    Location
    Bulgaria
    MS-Off Ver
    2013
    Posts
    10

    Smile Loop Macro

    Hello,

    I want to do something, but not quite sure how.
    Capture.PNG
    I have a table in which I add "x" in all of the green Cells( B2:P17) and I have a Specific start date in cell B1, and every 56 days like an automatic cycle I want the values in range B2:P17 to be deleted.

    Please give advice.
    Thank you in Advance!
    Last edited by Afir1k; 08-03-2017 at 07:59 AM.

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Loop Macro

    Hello
    It is better to upload sample of your file ...
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Registered User
    Join Date
    08-03-2017
    Location
    Bulgaria
    MS-Off Ver
    2013
    Posts
    10

    Re: Loop Macro

    One moment

  4. #4
    Registered User
    Join Date
    08-03-2017
    Location
    Bulgaria
    MS-Off Ver
    2013
    Posts
    10

    Re: Loop Macro

    Delivery Time.xlsx
    here it is

  5. #5
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Loop Macro

    Can you give more details or put some of your desired output?
    How would you like to put x and on what basis?

  6. #6
    Registered User
    Join Date
    08-03-2017
    Location
    Bulgaria
    MS-Off Ver
    2013
    Posts
    10

    Re: Loop Macro

    i have 13 Products and the green Cells represent the quantity available on stock.
    and when an X is entered it means it was requested , and these Products come automatically in a Cycle of 56 days and that way we track what we have on stock and what we sold

  7. #7
    Registered User
    Join Date
    08-03-2017
    Location
    Bulgaria
    MS-Off Ver
    2013
    Posts
    10

    Re: Loop Macro

    So when 56 days pass i want these cells to be cleared automatically because we have the quantities again , like a refill if all are not bought

  8. #8
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Loop Macro

    It is still not clear for me. May be someone else can help you out but it will be better if you put the expected output

  9. #9
    Registered User
    Join Date
    08-03-2017
    Location
    Bulgaria
    MS-Off Ver
    2013
    Posts
    10

    Re: Loop Macro

    Capture.PNG
    so it looks like this and after every 56 days i want it to look like this
    Capturse.PNG
    so I add "x" from time to time and when 56 days pass I want the Cells to go back to green
    Last edited by Afir1k; 08-03-2017 at 08:48 AM.

  10. #10
    Registered User
    Join Date
    08-03-2017
    Location
    Bulgaria
    MS-Off Ver
    2013
    Posts
    10

    Re: Loop Macro

    is this more clear ?
    or is it even possible?
    Thanks for your time I appreciate it.

  11. #11
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Loop Macro

    Try this code. May be a start for you
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    08-03-2017
    Location
    Bulgaria
    MS-Off Ver
    2013
    Posts
    10

    Re: Loop Macro

    oh ... yes i did not specify what i wanted....sorry
    So I only want the "X"s to disappear every 56 not everything else. Nothing wrong whit the colors.

  13. #13
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Loop Macro

    This will clear the Xs 56 days after the date in cell B1.
    The macro automatically runs when you open the file.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  14. #14
    Registered User
    Join Date
    08-03-2017
    Location
    Bulgaria
    MS-Off Ver
    2013
    Posts
    10

    Re: Loop Macro

    Is there a way to make it like a Cycle every 56 days.
    Like i have today's date 3.8.2017 after 56 it clears and when 28.9.2017 comes and the data delete an after another 56 it deletes again and so on ?

  15. #15
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Loop Macro

    I think AlphaFrog's code do what you are telling about in post #14 ..

  16. #16
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Loop Macro

    Quote Originally Posted by Afir1k View Post
    Is there a way to make it like a Cycle every 56 days.
    Like i have today's date 3.8.2017 after 56 it clears and when 28.9.2017 comes and the data delete an after another 56 it deletes again and so on ?
    This will do the same thing but also add 56 days to the date in B1 and then delete again on the next date. Is that what you want?

    Please Login or Register  to view this content.

  17. #17
    Registered User
    Join Date
    08-03-2017
    Location
    Bulgaria
    MS-Off Ver
    2013
    Posts
    10

    Re: Loop Macro

    Thank you very much!

+ 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. loop macro - copy, paste, run macro
    By icestorm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-01-2015, 09:16 AM
  2. Replies: 3
    Last Post: 01-07-2015, 12:19 PM
  3. [SOLVED] Have a loop macro loop for all visible worksheets
    By Graeme-Black in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-22-2014, 11:01 AM
  4. Novice with VBA and macro writing needing help to loop a macro unti no data
    By jrongone in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-25-2013, 12:19 PM
  5. [SOLVED] Copy dynamically changing column and Paste using VBA Loop (Loop within Loop)
    By nixon72 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-12-2013, 12:46 PM
  6. Macro to delete rows with a Zero value. Macro seems to be in continual loop
    By jnorri in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-07-2012, 03:20 PM
  7. Macro Loop Broken. Detects Max but doesn't continue loop
    By herchenbach in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2011, 12:17 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