Hide/display columns or rows in an Excel document
来源:互联网 发布:智多星软件视频教程 编辑:程序博客网 时间:2024/05/22 10:32
This solution applies to external Excel files, not to the QuickTest Professional data table.
You can use the Excel object model to automate hiding or displaying rows and columns in an Excel workshee
Example:
' Create the Excel object
Set ExcelObj = CreateObject("Excel.Application")
ExcelObj.Visible = true
' Open up the Excel file which has the rows or columns to be hidden.
ExcelObj.Workbooks.Open "C:\temp\Book1.xls"
' Get the first sheet
Set NewSheet = ExcelObj.Sheets.Item(1)
' Hide the first row and column
NewSheet.Cells(1,1).EntireRow.Hidden = True
NewSheet.Cells(1,1).EntireColumn.Hidden = True
' Save the Excel file
ExcelObj.ActiveWorkbook.Save
' Close the application and clear the object reference
ExcelObj.Quit
Set ExcelObj = Nothing
To hide columns or rows, set the Hidden property to True.
To display columns or rows, set the Hidden property to False.
0 0
- Hide/display columns or rows in an Excel document
- Add cells, rows, or columns to an Excel document
- Lock rows and columns in Excel
- Read and Display Data From an Excel File (.xsl or .xlsx) in ASP.NET
- Autosize the columns and rows in MSFlexGrid
- Hide the columns in table-control
- ASP: Display all columns that in dataset
- Change the font and cell color in an Excel document
- Add formatting to the cell in an Excel document
- Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral or
- Highlighting Rows in an ASP.Net DataGrid...
- How to create an Excel sheet or chart in VC?
- How to create an Excel sheet or chart in VC?
- Hide an Image in Another Image
- Invalid update: invalid number of rows in section 0. The number of rows contained in an ....
- Converting Oracle rows to columns
- Hide and Don’t Display N/A Attributes in Magento
- How to access selected rows in an af:selectManyChoice component
- SharedPreferences保存android数据
- android popupWindow 弹出窗体
- php简单上传类
- C#控制TP路由器自动断线、重连
- BIOS加载MBR到内存地址0x7C00的由来
- Hide/display columns or rows in an Excel document
- ListView嵌套ViewPager
- socket 10053 错误
- ZOJ 3229 无源汇上下界最大流
- 字符串中单词的个数(状态机的使用)
- 对话框的OnPaint()和OnEraseBkgnd()消息的理解
- HTML5版模拟交通灯
- 字节对齐
- android ScreenLockReceiver 锁屏监听