Hello Master,
I need Help in my program always show wraning type missmatch, I dont know where is the error code. I already check and nothing code wrong.
Anyone can help me please.
Thanks,
AsparAgus
I need Help in my program always show wraning type missmatch, I dont know where is the error code. I already check and nothing code wrong.
Code:
Private Sub Workbook_Open()
'fungsi untuk menjalankan sheet saat workbook open
Worksheets("Thailand").Select 'tambahin worksheet kalo mau jalanin sheet yang berbeda
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
.EnableEvents = False
End With
Dim stDate As Long: stDate = Date + 2
Dim stDate1 As Long: stDate1 = Date + 4
Dim count1 As Integer
Dim sh As Worksheet
Dim wbNew As Workbook
count1 = 0
'filter data yang sesuai kondisi Today + 3
' With Sheet1
' .AutoFilterMode = False
'with .range
Range("A4:AP5000").AutoFilter 1, Criteria1:=">" & stDate, _
Operator:=xlAnd, Criteria2:="<" & stDate1
' .AutoFilter
' End With
' End With
'Application.CutCopyMode = False
For Each cell In Range("A5:A5000") 'range cell
If cell.Value = Date + 3 Then
'Cells(3, 1).Interior.ColorIndex = 3
'Cells(3, 1).Font.ColorIndex = 1
'Range("A3").Value = cell.Value 'menampilkan tanggal yang sesuai dengan tanggal hari ini +3
'Columns(3).Delete
count1 = count1 + 1
Else
End If
Next
Range("B4:CG5000").Copy 'copy data yang sudah di filter
Workbooks.Add 'create new workbook
Set wbNew = ActiveWorkbook 'setting new workbook sebagai active workbook
[A4].PasteSpecial xlPasteAll 'paste data yang di copy ke new workbook
[A4].PasteSpecial xlPasteValues
wbNew.Sheets(1).Name = "Monitoring List CKD Thailand" ' setting untuk mengubah nama sheet di workbook baru
wbNew.SaveAs "Z:\SAP\Monitoring List CKD & Local\Reminder\Local\Reminder Monitoring Lot CKD Thailand " & Format(Now, "dd-mmm-yy") & ".xlsx"
wbNew.Close 'close new workbook
' kondisi sending email hanya 1 kali
If count1 > 0 Then
SendReminderMail
ElseIf count1 = 0 Then
End If
'Worksheets("Monitoring List CKD F-Series").Select 'tambahin worksheet kalo mau jalanin sheet yang berbeda
With Application
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
.EnableEvents = True
End With
End Sub
Anyone can help me please.
Thanks,
AsparAgus