首页 > TAG信息列表 > UsedRange

Delphi 利用NativeExcel 实现 导入(返回clientdataset) 导出

1、先要安装控件\NativeExcel310(自行下载) 2、添加单元引用 uses nexcel; 3、转换方法 function ExcelToDataSet(fileNmae:string):TClientDataSet; var od: TOpenDialog; wb: IXLSWorkbook; ws: IXLSWorksheet; irow,J: integer; v: Variant; ClientDataSet1: TClientDataSet;

读取行和列的值

iRows=activesheet.usedrange.rows.countiColumns=activesheet.usedrange.Columns.count'如果表格前面的几行或几列可能是空的,需要获得最下面的行数和最右面的列数:with activesheet.usedrange iEndRow=.rows.count+.row-1 iEndColumn=.Columns.count+.column-1end with '获

VBA删除空白行列

1 '删除空行 2 Sub DeleteEmptyRows() 3 Dim LastRow As Long, r As Long 4 LastRow = ActiveSheet.UsedRange.Rows.Count 5 LastRow = LastRow + ActiveSheet.UsedRange.Row - 1 6 7 For r = LastRow To 1 Step -1 8 If WorksheetFunction.CountA(Rows(r)) = 0 Then R