I have the following code
Sub zbaesttest()
Dim day As Integer
Set Cell1 = Range("A8").End(xlDown)
Set Cell2 = Range("A8").End(xlDown).Offset(0, 10)
'Test for ZBA Estimate formula
'If no formula then copy appropriate weekday ZBA formula to cell
If Cell2.HasFormula = False Then _
day = Application.WorksheetFunction.Weekday(Cell1)
Select Case day
Case 1: Exit Sub
Case 2: Range("zbawkday2").Copy Cell2.Paste
Case 3: Range("zbawkday3").Copy Cell2.Paste
Case 4: Range("zbawkday4").Copy Cell2.Paste
Case 5: Range("zbawkday5").Copy Cell2.Paste
Case 6: Range("zbawkday6").Copy Cell2.Paste
Case 7: Exit Sub
End Select
End If
What this is supposed to do is look at Cell2. If there is no formula in Cell2, it copies a formula into Cell2 based on the weekday found in the date for Cell1. However when I run it I keep getting a Run Time Error 438: Object doesn't support this property. What exactly does this mean? Does it have to do with how I'm trying to paste the formula?
End Sub[/code]
Sub zbaesttest()
Dim day As Integer
Set Cell1 = Range("A8").End(xlDown)
Set Cell2 = Range("A8").End(xlDown).Offset(0, 10)
'Test for ZBA Estimate formula
'If no formula then copy appropriate weekday ZBA formula to cell
If Cell2.HasFormula = False Then _
day = Application.WorksheetFunction.Weekday(Cell1)
Select Case day
Case 1: Exit Sub
Case 2: Range("zbawkday2").Copy Cell2.Paste
Case 3: Range("zbawkday3").Copy Cell2.Paste
Case 4: Range("zbawkday4").Copy Cell2.Paste
Case 5: Range("zbawkday5").Copy Cell2.Paste
Case 6: Range("zbawkday6").Copy Cell2.Paste
Case 7: Exit Sub
End Select
End If
What this is supposed to do is look at Cell2. If there is no formula in Cell2, it copies a formula into Cell2 based on the weekday found in the date for Cell1. However when I run it I keep getting a Run Time Error 438: Object doesn't support this property. What exactly does this mean? Does it have to do with how I'm trying to paste the formula?
End Sub[/code]