VBA Help on creating input path macro tab on sheet1

Mallesh23

Well-known Member
Joined
Feb 4, 2009
Messages
983
Office Version
  1. 2010
Platform
  1. Windows
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
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top