以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- excel vba 冻结窗口、筛选的问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=194461) |
-- 作者:donald0001 -- 发布时间:2024/12/12 15:07:00 -- excel vba 冻结窗口、筛选的问题 Dim App As New MSExcel.Application App.Visible = True Dim outwb As MSExcel.Workbook = App.WorkBooks.Open(dlg.FileName) Dim mysheet As MSExcel.WorkSheet = outwb.WorkSheets("明细") mysheet.SplitColumn = 0 \'拆分0列 mysheet.SplitRow = 1 \'拆分首行 mysheet.FreezePanes = True \'冻结拆分窗口 mysheet.Range("1:1").AutoFilter \'筛选 以上是打开一个Excel文件,冻结首行,然后筛选。倒数4四行是录制宏改编的,但是foxtable无法执行,请教专家怎么改动,谢谢!
|
-- 作者:有点蓝 -- 发布时间:2024/12/12 15:53:00 -- Dim App As New MSExcel.Application Try Dim outwb As MSExcel.Workbook = App.WorkBooks.Open("D:\\问题\\123.xls") Dim mysheet As MSExcel.WorkSheet = outwb.WorkSheets(1) mysheet.Activate() mysheet.Range("A2").Select() \' 选择的单元格下移一位,从而不冻结首行 App.ActiveWindow.FreezePanes = True mysheet.Range("A1").AutoFilter(1) \'筛选 App.Visible = True Catch ex As Exception Output.Show(ex.Message) End Try
|
-- 作者:donald0001 -- 发布时间:2024/12/12 16:39:00 -- 太好了,十分感谢! |