A
artisdepartis
Dear Experts, in my quest to explore macro's I am currently lost. I
learn mostly by creative copy pasting and a lot of trail and
error... ;-) However, i am... stuck. Is there anyone who can review my
code and tell me why I get an error telling me the 'Object does not
support the property or method'. The lines generating this error have
been put between >>>>
(I copied this from a sheet where i use this also and it does work!)
Sub Write_Results()
Dim sDateExtract As String
Dim FoundCell As Range
Dim lFiledate As Long
Dim rLastSplitsPerAI As Range
Dim LSPAI As Long
Dim sFileNameResults As String
0 If lFiledate = 0 Then
lFiledate = InputBox("Enter date of reportation. (yyyymmdd)")
MsgBox "You will create the SE Report for " & lFiledate
Else
End If
sFileNameResults = "SE statistiek " & lFiledate & ".xls"
LSPAI = 126
Set rLastSplitsPerAI = Range(Cells(3, 1), Cells(3, LSPAI))
sDateExtract = Mid(lFiledate, 5, 2) & "/" & Right(lFiledate, 2) & "/"
& Left(lFiledate, 4)
MsgBox sDateExtract
Windows("overview_f.xls").Activate
Sheets("SPAI").Select
Set FoundCell = Range("A1:A800").Find _
(What:=DateValue(sDateExtract), LookIn:=xlFormulas)
Workbooks("overview_f.xls").Sheets("SPAI").Range(Cells(FoundCell.Row,
2), Cells(FoundCell.Row, 127)).Value _
= Workbooks(sFileNameResults).Sheets("SPAI").rLastSplitsPerAI.Value
Else
MsgBox "Oops... something went wrong, check things manually plz."
End If
End Sub
learn mostly by creative copy pasting and a lot of trail and
error... ;-) However, i am... stuck. Is there anyone who can review my
code and tell me why I get an error telling me the 'Object does not
support the property or method'. The lines generating this error have
been put between >>>>
(I copied this from a sheet where i use this also and it does work!)
Sub Write_Results()
Dim sDateExtract As String
Dim FoundCell As Range
Dim lFiledate As Long
Dim rLastSplitsPerAI As Range
Dim LSPAI As Long
Dim sFileNameResults As String
0 If lFiledate = 0 Then
lFiledate = InputBox("Enter date of reportation. (yyyymmdd)")
MsgBox "You will create the SE Report for " & lFiledate
Else
End If
sFileNameResults = "SE statistiek " & lFiledate & ".xls"
LSPAI = 126
Set rLastSplitsPerAI = Range(Cells(3, 1), Cells(3, LSPAI))
sDateExtract = Mid(lFiledate, 5, 2) & "/" & Right(lFiledate, 2) & "/"
& Left(lFiledate, 4)
MsgBox sDateExtract
Windows("overview_f.xls").Activate
Sheets("SPAI").Select
Set FoundCell = Range("A1:A800").Find _
(What:=DateValue(sDateExtract), LookIn:=xlFormulas)
Workbooks("overview_f.xls").Sheets("SPAI").Range(Cells(FoundCell.Row,
2), Cells(FoundCell.Row, 127)).Value _
= Workbooks(sFileNameResults).Sheets("SPAI").rLastSplitsPerAI.Value
Else
MsgBox "Oops... something went wrong, check things manually plz."
End If
End Sub