M
mariasa
Hi guys,
could you pls have a look at my code and let me know why i keep getting
this error msg every time i try to execute it?
Thanks so much,
Maria
Sub CommandButtonDRG_Click()
Dim i As Integer
Dim curCell As Date
Dim startDate As Date
Dim endDate As Date
Dim SheetNumber As Integer
SheetNumber = "949"
startDate = Sheets(SheetNumber).Range("c2").Value
endDate = Sheets(SheetNumber).Range("e2").Value
Sheets(SheetNumber).Columns("C:C").Select
Selection.NumberFormat = "m/d/yyyy"
Sheets(SheetNumber).Range("c2").Select
ActiveCell.FormulaR1C1 = startDate
i = 3
Do
curCell = Sheets(SheetNumber).Cells(i, 3).Select
ActiveCell.FormulaR1C1 = "=dvstradedate(R[-1]C,1)"
i = i + 1
Loop Until Sheets(SheetNumber).Cells(i - 1, 3).Value = endDate
End
End Sub
could you pls have a look at my code and let me know why i keep getting
this error msg every time i try to execute it?
Thanks so much,
Maria
Sub CommandButtonDRG_Click()
Dim i As Integer
Dim curCell As Date
Dim startDate As Date
Dim endDate As Date
Dim SheetNumber As Integer
SheetNumber = "949"
startDate = Sheets(SheetNumber).Range("c2").Value
endDate = Sheets(SheetNumber).Range("e2").Value
Sheets(SheetNumber).Columns("C:C").Select
Selection.NumberFormat = "m/d/yyyy"
Sheets(SheetNumber).Range("c2").Select
ActiveCell.FormulaR1C1 = startDate
i = 3
Do
curCell = Sheets(SheetNumber).Cells(i, 3).Select
ActiveCell.FormulaR1C1 = "=dvstradedate(R[-1]C,1)"
i = i + 1
Loop Until Sheets(SheetNumber).Cells(i - 1, 3).Value = endDate
End
End Sub