Selecting another workbook to import

bkeat

New Member
Joined
Jan 2, 2013
Messages
22
Hi

I am a beginner with vba and I am stuck in trying to import another excel workbook with its location being flexible as the file-name will change.


This is what i got so far
Code:
Dim selectFile As String




selectFile = Application.GetOpenFilename(FileFilter:="Excel Files, *.xls*" _
, FilterIndex:=1, Title:="Open Excel file" _
, MultiSelect:=False)


If selectFile = "False" Then
MsgBox ("Please Select File!")
End If

Having difficulty in building the next block of code for the import.


I am using excel 2010.

Any help would be most appreciated.

Thanks.
 

Forum statistics

Threads
1,226,795
Messages
6,193,047
Members
453,772
Latest member
aastupin

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