-
Feb 21st, 2006, 12:10 PM
#1
Thread Starter
New Member
about error 450: Wrong number of arguments or invalid property assignment
Hi,
What I did was simply to change date 'MMM-YY' based on user inputs. The code goes like this:
Sub ChngMonth()
MMMYY = InputBox("Enter The Last Data Month (mmm-yy):")
If MMMYY = "" Then Exit Sub
ddmmmyy = "15-" & MMMYY
For i = 0 To 330 Step 30
j = 12 - i / 30
Worksheets("Monthlist").Cells(1, j) = "'" & format(CDate(ddmmmyy) - i, "mmm-yy")
Next
End Sub
When I run it, I will have 450 for 'format()' statement. But the funny thing is I don't always get that error. For some workbooks, I do; the others, I don't. I guess it has something to do with the way the book was set up; or some options that I didn't select. If the problem is with "Wrong number of arguments", how come for some workbooks it works, some not, using the same statement.
Thanks in advance.
Feipe
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|