Hi Team,
I have created a macro for consolidation of data from different workbook.
I have asked user to put input in sheet1.range ("B4"). here I am looking for someone to help me in creating folder browser tab besides the input path code. and below that output path browser macro button. if possible also suggest date calender
Please provide me some coding?........Thanks in advance !!!
Below are my vba coding.
Sub CosolodiateFromDifferentworkbook()
Dim wbk As Workbook
Dim sht As Worksheet, Nsht As Worksheet
Application.ScreenUpdating = False
FP = Sheet1.Range("b4").Value
FN = Dir(FP)
Set sht = Sheets.Add(, Sheets("Sheet1"))
sht.Name = "Master"
Do Until FN = ""
lr = sht.Cells(Rows.Count, 1).End(xlUp).Row
Set wbk = Workbooks.Open(FP & FN)
' To open workbook , need to mention File path & File name
Set Nsht = wbk.Sheets(1)
Nsht.Range("A1").CurrentRegion.Copy sht.Range("A" & lr)
wbk.Close False
FN = Dir
Loop
sht.Range("A1").CurrentRegion.EntireColumn.AutoFit
ActiveWindow.DisplayGridlines = True
Set wbk = Nothing
Application.ScreenUpdating = True
MsgBox " Data consolodiate successfully !", vbInformation, "Data Import"
End Sub
Regards,
Mallesh
I have created a macro for consolidation of data from different workbook.
I have asked user to put input in sheet1.range ("B4"). here I am looking for someone to help me in creating folder browser tab besides the input path code. and below that output path browser macro button. if possible also suggest date calender
Please provide me some coding?........Thanks in advance !!!
Below are my vba coding.
Sub CosolodiateFromDifferentworkbook()
Dim wbk As Workbook
Dim sht As Worksheet, Nsht As Worksheet
Application.ScreenUpdating = False
FP = Sheet1.Range("b4").Value
FN = Dir(FP)
Set sht = Sheets.Add(, Sheets("Sheet1"))
sht.Name = "Master"
Do Until FN = ""
lr = sht.Cells(Rows.Count, 1).End(xlUp).Row
Set wbk = Workbooks.Open(FP & FN)
' To open workbook , need to mention File path & File name
Set Nsht = wbk.Sheets(1)
Nsht.Range("A1").CurrentRegion.Copy sht.Range("A" & lr)
wbk.Close False
FN = Dir
Loop
sht.Range("A1").CurrentRegion.EntireColumn.AutoFit
ActiveWindow.DisplayGridlines = True
Set wbk = Nothing
Application.ScreenUpdating = True
MsgBox " Data consolodiate successfully !", vbInformation, "Data Import"
End Sub
Regards,
Mallesh