Hey all...
I ran and tested this macro on Friday, and everything worked fine. Now this morning when I run it, I get an error. The error messages the comes up is:
Run-time error '1004':
Application-defined or object-defined error
and it shows up on this line:
I have omitted some lines of code, that do no impact this situation, just an FYI...
Thanks for any help!
Josh
I ran and tested this macro on Friday, and everything worked fine. Now this morning when I run it, I get an error. The error messages the comes up is:
Run-time error '1004':
Application-defined or object-defined error
and it shows up on this line:
Code:
Sub Formulae_for_daily_summary()
Dim entered_date As Date
entered_date = InputBox("Please enter the date (MM/DD/YYYY):", "What Date?", Date - 0)
Dim eight_digit_date As Long
With Sheets("History restated")
.Cells(1, 16).Value = entered_date
eight_digit_date = .Cells(1, 17).Value
Dim entered_state As String
entered_state = InputBox("Please enter the state abbreviation:")
Dim quote_argument As String, sale_argument As String
quote_argument = "'[" & entered_state & " daily results by agent (" & eight_digit_date & ").xls]1'!C1:C1"
Dim i As Long
i = 3
Do While ((.Cells(i + 1, 2) <> "" And .Cells(i + 2, 2) <> "") Or (.Cells(i + 1, 2) = "" And .Cells(i + 2, 2) <> "") Or (.Cells(i + 1, 2) <> "" And .Cells(i + 2, 2) = ""))
i = i + 1
Loop
[b].Cells(3, 4).Resize(i - 2, 1).FormulaR1C1 = "=countif(" & quote_argument & ",RC[-3]&""-""&""Auto""&""-""&""Quote"")"[/b]
I have omitted some lines of code, that do no impact this situation, just an FYI...
Thanks for any help!
Josh