I have a csv file were the Date format is correct DD-MM-YYYY (ref screen CopyPaste Date), once i copy and paste this data to excel vba file in a sheet the last year date gets convered to 17/06/22 (ref screen RawFile Date) which is not correct copy and paste
to avoid this I have put the formula as in D9 so that all the calculaionts should work
=IFERROR(DATEVALUE(E9),VALUE(TEXT(E9,"DD-MM-YYYY")))
But it is not working as required, any help on this.
Scrip below is for copy and paste
to avoid this I have put the formula as in D9 so that all the calculaionts should work
=IFERROR(DATEVALUE(E9),VALUE(TEXT(E9,"DD-MM-YYYY")))
But it is not working as required, any help on this.
Scrip below is for copy and paste
VBA Code:
'=====================================================================================
' 1. ImportDaily Fiber_OLT_Volume_Makkah_report
'=====================================================================================
sub copypaste()
fname = Dir(Fpath & "\" & "1 Fiber Makkah report.csv")
If Sheets("Reference").Range("b2").Value = "1 Fiber Makkah report" Then
Sheets("Fiber RawData").Visible = True
Sheets("Fiber RawData").Unprotect "etmc123$"
Windows("Email Body TP-Fixed Access Hajj Report 1444 - V1.xlsm").Activate
ActiveWorkbook.Sheets("Fiber RawData").Activate
ActiveSheet.Range("E8:N5000").ClearContents
'Cells.Select
'Selection.ClearContents
Application.CutCopyMode = False
Set wbsource = Workbooks.Open(Fpath & "\" & fname)
Windows(fname).Activate
Range("B1:I500").Select
'Cells.Select
Selection.Copy
Windows("Email Body TP-Fixed Access Hajj Report 1444 - V1.xlsm").Activate
ActiveWorkbook.Sheets("Fiber RawData").Activate
ActiveSheet.Range("E8").Select
ActiveSheet.Paste
Application.CutCopyMode = False
wbsource.Close
End If
End Sub