WeekNum Trouble

G

Guest

I am trying to return a simple week number based on the value input on a user
form and place the value in a work sheet column.

I have tried the WeekNum formula but it gives me "Compile Error: Sub or
Function Not defined"

I have the Analysis ToolPak installed.

I am using a "pop-up" calendar to input the date for this field. Would that
cause the problem perhaps????

The Macro posts all the values of the userform to the last row of the spread
sheet. I want a column that simple adds in a week number. Nothing fancy. The
code that gives me the error is as follows:

'Determine the next empty row
NextRow = Range("A" & Rows.Count).End(xlUp).Offset(1).Row

'Transfer Data
Cells(NextRow, 5) = QCMonitor.RevLast.Value
Cells(NextRow, 6) = QCMonitor.RevFirst.Value
Cells(NextRow, 7) = QCMonitor.Dept.Value
Cells(NextRow, 8) = QCMonitor.RevDate.Value
Cells(NextRow, 9) = QCMonitor.AcctNumber.Value

'Input values for house-keeping cells
Cells(NextRow, 1) = 1
Cells(NextRow, 2) = Format(QCMonitor.RevDate.Value, "mmm")
Cells(NextRow, 3) = WeekNum(QCMonitor.RevDate.Value, 1)
Cells(NextRow, 4) = Year(QCMonitor.RevDate.Value)

Everything works but the WeekNum Formula, the answer is probably very
simple, but I have tried numberous other formulas without success.

Ideas anybody?

WillRn

I
 
R

Ron de Bruin

Hi will

Tools Add-ins and also install Analysis ToolPak VBA
In the VBA editor go to Tools>References and select atpvbaen.xla
 
G

Guest

I have that one installed also . . . : (

Ron de Bruin said:
Hi will

Tools Add-ins and also install Analysis ToolPak VBA
In the VBA editor go to Tools>References and select atpvbaen.xla
 
G

Guest

Well, . . .Now that i've decided to read the post, . . . I saw the part about
adding in the atpvbaen.xla.

It works now,

Much thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

next empty row 1
UserForm Result Posting 2
Find Next Empty Row 3
autofilter 2
ListBox Question 7
User Form 4
UserForm/If Help 4
Accessing a non-active sheet from a userform 2

Top