+ Reply to Thread
Results 1 to 2 of 2

Make a loop that goes around around and around

Hybrid View

  1. #1
    Registered User
    Join Date
    11-24-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    2

    Make a loop that goes around around and around

    Hi there!
    Is there anyone who can help me to make this schedule that i linked
    to loop? Right now it stops and then the numbers vabish but
    I would really like it to go around when i press next week, and it to go
    back when i press last week.

    The numbers will then be replaced by name since this will be a
    rotating schedule.. Hope there is anyone out there who can help me.
    Best regards
    Kristian
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    928

    Re: Make a loop that goes around around and around

    Have a try with these minor changes to your code:
    Option Explicit
    
    Sub Week_Up()
    '
    'macro recorded the 25/11/2012 by rollis13
    '
        Application.ScreenUpdating = False
        If Range("E1").Value > 51 Then Exit Sub
        If IsNumeric(Range("E1")) Then Range("E1") = Range("E1") + 1
        Range("B12:F12").Cut
        Range("B14").Select
        ActiveSheet.Paste
        Range("B3:F11").Cut
        Range("B4").Select
        ActiveSheet.Paste
        Range("B14:F14").Cut
        Range("B3").Select
        ActiveSheet.Paste
        Range("A1").Select
        Application.ScreenUpdating = True
        
    End Sub
    
    Sub Week_Down()
    '
    'macro recorded the 25/11/2012 by rollis13
    '
        Application.ScreenUpdating = False
        If Range("E1").Value < 2 Then Exit Sub
        If IsNumeric(Range("E1")) Then Range("E1") = Range("E1") - 1
        Range("B3:F3").Cut
        Range("B14").Select
        ActiveSheet.Paste
        Range("B4:F12").Cut
        Range("B3").Select
        ActiveSheet.Paste
        Range("B14:F14").Cut
        Range("B12").Select
        ActiveSheet.Paste
        Range("A1").Select
        Application.ScreenUpdating = True
    
    End Sub
    Attached Files Attached Files

+ 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