Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default I'm only getting 0

Hiya,

I have the following VB rules, always worked until this year.
The result is that I'm now getting only 0 and not anymore the week numbers:

Can someone advice me what could be wrong?

Cheers
------------------------------
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(1, i) = repWeek(1, t) And data(1, i) <= repWeek(2, 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
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



All times are GMT +1. The time now is 11:17 AM.

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

About Us

"It's about Microsoft Excel"