-
Solved: Using the EOMonth Function
I get an error when I attempt to use the EOMonth Function. I've pasted both the creation of the array and the attempt to extract a value and use the function. Thank you for your help.
[VBA]
For ACounter = 2 To DataCount
MultiArr(ACounter, 2) = Format(Cells(ACounter, 2).Value, "mm/dd/yyyy")
Next ACounter
Dim TestDate As Date
Dim SecondDate As Date
Dim abc As Integer
For abc = 2 To DataCount
If MultiArr(abc, 1) = "ThisOne" Then
TestDate = MultiArr(abc, 2)
SecondDate = WorksheetFunction.EOMonth(TestDate)
Else
End If
Next abc
[/VBA]
Edited 10-Apr-07 by geekgirlau. Reason: insert vba tags
-
Do you have Analysis ToolPak loaded?
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
-
EOMONTH is not a worksheet function exposed to VBA.
[vba]
For ACounter = 2 To DataCount
MultiArr(ACounter, 2) = Format(Cells(ACounter, 2).Value, "mm/dd/yyyy")
Next ACounter
Dim testDate As Date
Dim SecondDate As Date
Dim abc As Integer
For abc = 2 To DataCount
If MultiArr(abc, 1) = "ThisOne" Then
testDate = MultiArr(abc, 2)
SecondDate = DateSerial(Year(testDate), Month(testDate) + 1, 0)
Else
End If
Next abc
[/vba]
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