Open a workbook using FileDialog and manipulate it in Excel VBA
Thankyou Frank.i got the idea. Here is the working code. Option Explicit Private Sub CommandButton1_Click() Dim directory As String, fileName As String, sheet As Worksheet, total As Integer Dim fd As Office.FileDialog Set fd = Application.FileDialog(msoFileDialogFilePicker) With fd .AllowMultiSelect = False .Title = “Please select the file.” .Filters.Clear .Filters.Add “Excel 2003”, “*.xls?” If .Show = … Read more