Posted to microsoft.public.excel.programming
|
|
Week Numbers
Hmm okay here we go:
Week Nbr Receive date Send Date
0 04-Jan-06 16-Dec-05
0 13-Jan-06 05-Jan-06
0 18-Jan-06 16-Jan-06
The Idea is that instead of a 0 there will be a week number.
little note
Week Nbr = Column A starting at row 4
Receive Date = Column B starting at row 4
Send Date = Column C starting at row 4
Do you need more info?
Cheers,
Willem
"Bob Phillips" wrote:
Willem,
Can you post some data that you have as well, just running that code is none
too informative yet.
The data, with the results you get and what you expect would be really
helpful.
--
HTH
Bob Phillips
(remove nothere from the email address if mailing direct)
"Observer" wrote in message
...
Hi Bod,
Thx for the reply.
Here is the overview I have
Thx Willem
Sub remainderUpdateWeeks()
Dim repWeek(2, 155)
Dim firstDate As Date
Dim lastDate As Date
Dim data(4, 30000)
Dim noOfItems
Dim currentSheet
Dim reminderBook
Application.ScreenUpdating = False
currentSheet = ActiveSheet.Name
reminderBook = ActiveWorkbook.Name
Workbooks("ESS makro book.xls").Activate
Sheets("weeks").Activate
For i = 0 To 155
repWeek(0, i) = Range("A2").Offset(i, 0)
repWeek(1, i) = Range("B2").Offset(i, 0)
repWeek(2, i) = Range("C2").Offset(i, 0)
Next
Workbooks(reminderBook).Activate
Sheets(currentSheet).Activate
For i = 1 To 30000
If Range("B4").Offset(i, 0) = "" Then Exit For
data(1, i) = Range("B4").Offset(i, 0) 'Received date
noOfItems = noOfItems + 1
Next
noOfItems = noOfItems - 1
For i = 0 To noOfItems
For t = 0 To 155
If data(0, i) = repWeek(0, t) And data(0, i) <= repWeek(0, t)
Then
data(0, i) = repWeek(0, t)
Exit For
Else
data(0, i) = 0
End If
Next
Next
For i = 0 To noOfItems
Range("A4").Offset(i, 0) = data(0, i)
Next
Application.ScreenUpdating = True
End Sub
"Bob Phillips" wrote:
Willem,
I think we need to see an example of the data, any formulae and any code
to
be able to make any sense of this.
--
HTH
Bob Phillips
(remove nothere from the email address if mailing direct)
"Observer" wrote in message
...
Hi All,
Currently I have a vb which was created by someone else it is to
calculated
week numbers in a worksheet.
Basicaly Column A (starts at A4) has the week nummer (which have to be
calculated) and Column B (Starts at B4) the Dates the paper was
received,
in
column C (Starts at C4) is the date when the doc was send to us.
Now the case is so that since this year (01-Jan-06) the result is
always 0
I have checked and tried but I don't understand :O( (i'm alos no
specialist).
Any help would be welcome.
If nessacery I can give the current formula
Kind Regards,
Willem
|