Thread: Loop in Excel
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default Loop in Excel

It occurred to me that you probably have more than one sheet in your
workbook and that it might not be sheet 1 that contains the data, so I added
a couple of lines that you can modifiy if needed to make sure the right
sheet is executing.

Private Sub Workbook_Open()
Dim sh As Worksheet
Set sh = Sheets("Sheet1") '<<<Change to actual sheet.
If Weekday(Date) < 2 Then
Exit Sub
ElseIf sh.Range("IV1") = Date Then '<<<Change cell if desired.
Exit Sub
Else
sh.Range("A10").Cut
sh.Range("A1").Insert Shift:=xlDown
sh.Range("IV1") = Date '<<<Change to match the other.
End If
ThisWorkbook.Save
End Sub




"Khan" wrote in message
...
In the Column "A" I have 10 Names and In the Column "B" I have
1,2,3........10 (as below) in Excel sheet. I want that every week Last
Name (Ebie) should come at the place of number one (Paul) In the
column A and rest of the all names should go down respectively. Every
week Bottom Name should Come at the place of Top Name. The Column B
will remain the same but name should be change every week
automatically last at the place of first and first at the place of
second and so on. How I can do it in Excell Programming.

Column A Column B

Paul 1
Mick 2
Terry 3
Joan 4
Justin 5
Jim 6
Jo 7
Kay 8
Chuck 9
Ebie 10