Hi all..
I want to extract the following zip files using macro with reference to date in Cell A1
cm08APR2011bhav.csv.zip
eq080411_csv.zip
fo08APR2011bhav.csv.zip
SCBSEALL0804.zip
I want to extract the following zip files using macro with reference to date in Cell A1
cm08APR2011bhav.csv.zip
eq080411_csv.zip
fo08APR2011bhav.csv.zip
SCBSEALL0804.zip
Code:
'unzip file================================================
Dim FSO As Object
Dim oApp As Object
Dim Fname As Variant
Dim FileNameFolder As Variant
Dim DefPath As String
Fname = "E:\Macros\Input\"E:\Macros\Input\cm" & Format(Workbooks("NSE Converter.xls").Sheets("Sheet1").Range("G2").Value, "ddmmmyyyy") & "bhav.csv.zip"
If Fname = False Then
'Do nothing
Else
'Destination folder
DefPath = "E:\Macros\Input\" '<<< Change path
If Right(DefPath, 1) <> "\" Then
DefPath = DefPath & "\"
End If
FileNameFolder = DefPath