none
Delete blank rows from excel

    Question

  • Hello Developers,

    I am trying to import data from excel into access using transferspreadsheet method but issue in in excel i only have 5000 rows and my vba code imports 47000 rows with 42000 blank records. How shall i get rid of this blank rows in excel.

    I have below code in access to import excel data

    Sub ImpFrmtXL()
    Dim LTotal As Long
    DoCmd.SetWarnings False
    
    
    
    
    Set objapp = CreateObject("Excel.Application")
    
                objapp.Visible = False
                Set wb = objapp.Workbooks.Open("L:\NEW\REAL.xlsx",true, false)
                Columns("A:A").Select
        Selection.NumberFormat = "@"
            ActiveWorkbook.Save
        ActiveWorkbook.Close
        
        DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
        "tblREAL", "L:\NEW\REAL.xlsx", True
    Set objapp = Nothing
    DoCmd.SetWarnings True
    
    End Sub




    • Edited by zaveri cc Wednesday, December 18, 2013 5:14 PM
    Wednesday, December 18, 2013 5:10 PM

Answers

All replies