Find dags dato (Format "dd-mmm")
HejJeg kan ikke få nedenstående kode til at finde "dags Dato" i kolonne C.
Det virker godt nok, når jeg søger manuelt via "Find og vælg"
Der er i C4 angivet datoen "02-01-2011"
I C5 er formlen = C4+1 (Formater celler = brugerdefineret "dd-mmm")
I C6 er formlen = C5+1 (Formater celler = brugerdefineret "dd-mmm")
I C7 er formlen = C6+1 (Formater celler = brugerdefineret "dd-mmm")
osv... ned til C368 = C367+1 (Formater celler = brugerdefineret "dd-mmm")
Hvad gør jeg forkert???
Dim sh1 As Worksheet
Set sh1 = Ark1
sh1.Select
ActiveWindow.Zoom = 70
Application.Cells(4, 3).Select
On Error GoTo ErrHandler
Dim strdate As String
Dim FoundCell As Range
Dim lReply As Long
strdate = Format(Date, "dd-mmm")
With sh1.Range("C:C")
Set FoundCell = .Find(What:=strdate, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
If Not FoundCell Is Nothing Then
Application.Goto FoundCell, True
FoundCell.EntireRow.Select
ActiveWindow.ScrollRow = ActiveCell.Row
Else
lReply = MsgBox("Date cannot be found. Try Again", vbYesNo)
If lReply = vbYes Then Run "Workbook_Open":
End If
End With
Exit Sub