Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
compile error - expected an array
Here is the code and I am getting a compile error...
any ideas? For a = Dates.Count To 0 Step -1 DTadj(a) = Application.WorksheetFunction.workday(Dates(a), 1, Holidays) - Dates(a) Next |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
compile error - expected an array
didn't Dim my variable correctly :)
"John" wrote: Here is the code and I am getting a compile error... any ideas? For a = Dates.Count To 0 Step -1 DTadj(a) = Application.WorksheetFunction.workday(Dates(a), 1, Holidays) - Dates(a) Next |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
compile error - expected an array
Next error - Workday isn't a worksheetfunction. It is in the Analysis
toolpak - VBA and should be called using application.Run (or if you have a reference to that addin, call it like a builtin VBA function). -- Regards, Tom Ogilvy "John" wrote: didn't Dim my variable correctly :) "John" wrote: Here is the code and I am getting a compile error... any ideas? For a = Dates.Count To 0 Step -1 DTadj(a) = Application.WorksheetFunction.workday(Dates(a), 1, Holidays) - Dates(a) Next |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
compile error - expected an array
Public Type Material
MatNum As Integer MatDate() As Date End Type Public matType() As Material Const MaxMaterials As Long = 12 Sub ABCEFG() ReDim matType(1 To MaxMaterials) For i = 1 To MaxMaterials ReDim matType(i).MatDate(1 To 10) Next End Sub -- Regards, Tom Ogilvy "John" wrote: Here is the code and I am getting a compile error... any ideas? For a = Dates.Count To 0 Step -1 DTadj(a) = Application.WorksheetFunction.workday(Dates(a), 1, Holidays) - Dates(a) Next |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
compile error - expected an array
thanks Tom...
For i = Dates.Count To 1 Step -1 DTadj(i) = (Application.Run.WORKDAY(Dates(i), 1, Holidays)) - Dates(i) Next this still doesn't work? "Tom Ogilvy" wrote: Next error - Workday isn't a worksheetfunction. It is in the Analysis toolpak - VBA and should be called using application.Run (or if you have a reference to that addin, call it like a builtin VBA function). -- Regards, Tom Ogilvy "John" wrote: didn't Dim my variable correctly :) "John" wrote: Here is the code and I am getting a compile error... any ideas? For a = Dates.Count To 0 Step -1 DTadj(a) = Application.WorksheetFunction.workday(Dates(a), 1, Holidays) - Dates(a) Next |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
compile error - expected an array
wow is that for my post? I am confused if it is..
"Tom Ogilvy" wrote: Public Type Material MatNum As Integer MatDate() As Date End Type Public matType() As Material Const MaxMaterials As Long = 12 Sub ABCEFG() ReDim matType(1 To MaxMaterials) For i = 1 To MaxMaterials ReDim matType(i).MatDate(1 To 10) Next End Sub -- Regards, Tom Ogilvy "John" wrote: Here is the code and I am getting a compile error... any ideas? For a = Dates.Count To 0 Step -1 DTadj(a) = Application.WorksheetFunction.workday(Dates(a), 1, Holidays) - Dates(a) Next |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
compile error - expected an array
to demonstrate usage:
set Holidays = Range("A1:A10") dt = application.Run("ATPVBAEN.XLA!Workday",date, 20, Holidays) Msgbox format(dt,"mmm dd, yyyy") Would show Oct 19, 2006 if there are no holidays in between. the other post was inadvertently posted there. It was for another thread. -- Regards, Tom Ogilvy "John" wrote: thanks Tom... For i = Dates.Count To 1 Step -1 DTadj(i) = (Application.Run.WORKDAY(Dates(i), 1, Holidays)) - Dates(i) Next this still doesn't work? "Tom Ogilvy" wrote: Next error - Workday isn't a worksheetfunction. It is in the Analysis toolpak - VBA and should be called using application.Run (or if you have a reference to that addin, call it like a builtin VBA function). -- Regards, Tom Ogilvy "John" wrote: didn't Dim my variable correctly :) "John" wrote: Here is the code and I am getting a compile error... any ideas? For a = Dates.Count To 0 Step -1 DTadj(a) = Application.WorksheetFunction.workday(Dates(a), 1, Holidays) - Dates(a) Next |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
compile error - expected an array
THANKS TOM!!!!!
"Tom Ogilvy" wrote: to demonstrate usage: set Holidays = Range("A1:A10") dt = application.Run("ATPVBAEN.XLA!Workday",date, 20, Holidays) Msgbox format(dt,"mmm dd, yyyy") Would show Oct 19, 2006 if there are no holidays in between. the other post was inadvertently posted there. It was for another thread. -- Regards, Tom Ogilvy "John" wrote: thanks Tom... For i = Dates.Count To 1 Step -1 DTadj(i) = (Application.Run.WORKDAY(Dates(i), 1, Holidays)) - Dates(i) Next this still doesn't work? "Tom Ogilvy" wrote: Next error - Workday isn't a worksheetfunction. It is in the Analysis toolpak - VBA and should be called using application.Run (or if you have a reference to that addin, call it like a builtin VBA function). -- Regards, Tom Ogilvy "John" wrote: didn't Dim my variable correctly :) "John" wrote: Here is the code and I am getting a compile error... any ideas? For a = Dates.Count To 0 Step -1 DTadj(a) = Application.WorksheetFunction.workday(Dates(a), 1, Holidays) - Dates(a) Next |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
compile error - expected an array
It's for a different question.
John wrote: wow is that for my post? I am confused if it is.. "Tom Ogilvy" wrote: Public Type Material MatNum As Integer MatDate() As Date End Type Public matType() As Material Const MaxMaterials As Long = 12 Sub ABCEFG() ReDim matType(1 To MaxMaterials) For i = 1 To MaxMaterials ReDim matType(i).MatDate(1 To 10) Next End Sub -- Regards, Tom Ogilvy "John" wrote: Here is the code and I am getting a compile error... any ideas? For a = Dates.Count To 0 Step -1 DTadj(a) = Application.WorksheetFunction.workday(Dates(a), 1, Holidays) - Dates(a) Next -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Compile Error: Expected Variable or Procedure, Not Project | Excel Programming | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming | |||
compile error: Expected: = ...Why? | Excel Programming | |||
Compile Error: Expected End Property | Excel Programming | |||
compile error: expected variable or function | Excel Discussion (Misc queries) |