Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Week Numbers

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Week Numbers

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Week Numbers

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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Week Numbers

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






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Week Numbers

see chip's page for all possible examples
of weeknum functions

http://www.cpearson.com/excel/weeknum.htm


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Observer wrote :

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






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Week Numbers

I can't see anywhere in the code that calculates the week number. It just
seems to shuffle fields around, but as they all start at zero, they end at
zero.

Do you just want to set column A to the week number of column B or C? If
so,which, but the code seeme overly complex for that simple function. You
could even do it with a formula.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Observer" wrote in message
...
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








  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Week Numbers

Hi Bob

As said the formula was created by someone else.
But the basic idea I want is I receive letters on a date these dates are
being entered and then in another column the Week nummer has to appear.
This all ofcourse in a very long list with many different dates :O)

Kind Regards,

Willem

"Bob Phillips" wrote:

I can't see anywhere in the code that calculates the week number. It just
seems to shuffle fields around, but as they all start at zero, they end at
zero.

Do you just want to set column A to the week number of column B or C? If
so,which, but the code seeme overly complex for that simple function. You
could even do it with a formula.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Observer" wrote in message
...
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









  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Week Numbers

You could just add a formula to A4 of

=WEEKNUM(B4)

and copy that down the column.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Observer" wrote in message
...
Hi Bob

As said the formula was created by someone else.
But the basic idea I want is I receive letters on a date these dates are
being entered and then in another column the Week nummer has to appear.
This all ofcourse in a very long list with many different dates :O)

Kind Regards,

Willem

"Bob Phillips" wrote:

I can't see anywhere in the code that calculates the week number. It

just
seems to shuffle fields around, but as they all start at zero, they end

at
zero.

Do you just want to set column A to the week number of column B or C? If
so,which, but the code seeme overly complex for that simple function.

You
could even do it with a formula.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Observer" wrote in message
...
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











  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Week Numbers

See

http://www.rondebruin.nl/weeknumber.htm

And
http://www.rondebruin.nl/isodate.htm




--
Regards Ron de Bruin
http://www.rondebruin.nl


"Observer" wrote in message ...
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








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
week numbers [email protected] Excel Discussion (Misc queries) 3 May 15th 07 08:40 PM
Moving week numbers Bob Excel Worksheet Functions 0 November 3rd 05 10:27 AM
I need to =a set of numbers to a given week day.ie 6031 = Wed ect Budman Excel Discussion (Misc queries) 2 October 25th 05 10:14 PM
Week Numbers gregork Excel Discussion (Misc queries) 2 February 19th 05 01:56 PM
Week Numbers Graham[_5_] Excel Programming 1 January 7th 04 04:48 PM


All times are GMT +1. The time now is 03:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"