Looking for help with the following. Need to modify the below vba code so that when it imports the data it only imports all the rows with data on them. Currently when it imports the zzmr9820o.xlsx file it also is bringing in empty rows below the data. Need it to find the lastrow on zzmr9820o.xlsx and then import into my excel table.
VBA Code:
Sub Import_Click()
Dim OpenFileName As String
Dim wb As Workbook
'Select and Open workbook
OpenFileName = Application.GetOpenFilename("zzmr9820o,*.xlsx")
If OpenFileName = "False" Then Exit Sub
Set wb = Workbooks.Open(OpenFileName)
'Get data EXAMPLE
ThisWorkbook.Sheets("Send Emails").Range("G:V").Value = wb.Sheets(1).Range("A:P").Value
MsgBox ("Import Complete")
wb.Close
End Sub