以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  Excel报表中指定行自动调整行高  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=71017)

--  作者:2900819580
--  发布时间:2015/7/3 10:59:00
--  Excel报表中指定行自动调整行高

 

以下红色代码是整个表都会调整行高,可是我只想调整指定的行高。上传附档。 

Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(fl)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
Dim Rg As MSExcel.Range = Ws.Cells

Rg.EntireRow.AutoFit  \'自动调整行高
App.Visible = True

ShowAppWindow(Pname,2)
Ws.PrintPreview

 

  S/No
序号
Material Coding
物料编码
Descriptions
物料名称
Specifications
规格型号
Quantity
数量
Unit Price
单价
Amount
金额(RMB)
Delivery Date
交货日期
Remarks
备注
<采购单管理,序号> [序号] [物料编码] [物料名称] [物料规格] [采购数量] [单价] [金额] [回复交货期]  

 下载信息  [文件大小:   下载次数: ]
点击浏览该文件:采购单.xls


--  作者:大红袍
--  发布时间:2015/7/3 11:12:00
--  
Dim Rg As MSExcel.Range = Ws.Range("A14:J" & (14+你要打印的行数))

Rg.EntireRow.AutoFit  \'自动调整行高
--  作者:2900819580
--  发布时间:2015/7/3 13:57:00
--  

Dim Rg As MSExcel.Range = Ws.Range("A14:J" & (14+你要打印的行数))

 

打印的行数,怎么样可以获取。他是变量的哟。

 

 


--  作者:大红袍
--  发布时间:2015/7/3 14:01:00
--  
Dim Rg As MSExcel.Range = Ws.Range("A14:J" & (14+Tables("采购单管理").BottomPosition-Tables("采购单管理").TopPosition))