VBA语句集100句_第1辑.txt_第1页
VBA语句集100句_第1辑.txt_第2页
免费预览已结束,剩余6页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

- page 1- excelvbavba 伯 vba 伯 (1 ) (1) option explicit option private module option compare text option base 1 1 (2) on error resume next vba , (3) on error goto errorhandler (4) on error goto 0 (5) application.displayalerts=false (6) application.screenupdating=false application.screenupdating=true (7) application.enable.cancelkey=xldisabled ctrl+break (8) workbooks.add() (9) workbooks( book1.xls).activate book1 (10) thisworkbook.save 湤 (11) thisworkbook.close (12) activeworkbook.sheets.count (13) activew (14) thisworkbook.name thisworkbook.fullname (15) activewindow.enableresize=false (16) application.window.arrange xlarrangestyletiled (17) activeworkbook.windowstate=xlmaximized (18) activesheet.usedrange.rows.count (19) rows.count () (20) sheets( sheet1).name= sum sheet1 sum - 1 - - page 2- excelvbavba 伯 (21) thisworkbook.sheets.add before:=worksheets(1) (22) activesheet.move after:=activeworkbook. _ sheets(activeworkbook.sheets.count) (23) worksheets(array( sheet1,sheet2).select 1 2 (24) sheets( sheet1).delete sheets(1).delete 1 (25) activeworkbook.sheets(i).name i (26) activewindow.displaygridlines=not activewindow.displaygridlines (27) activewindow.displayheadings=not activewindow.displayheadings (28) activesheet.usedrange.formatconditions.delete (29) cells.hyperlinks.delete (30) activesheet.pagesetup.orientation=xllandscape activesheet.pagesetup.orientation=2 (31) activesheet.pagesetup.rightfooter=activeworkbook.fullname activesheet.pagesetup.leftfooter=application.username / (32) activecell.currentregion.select range(activecell.end(xlup),activecell.end(xldown).select (33) cells.select (34) range( a1).clearcontents a1 selection.clearcontents range( a1:d4).clear a1 d4 (35) cells.clear (36) activecell.offset(1,0).select (37) range( a1).offset(columnoffset:=1)range( a1).offset(,1) range( a1).offset(rowoffset:=-1)range( a1).offset(-1) (38) range( a1).copy range( b1) a1b1 - 2 - - page 3- excelvbavba 伯 range( a1:d8).copy range( f1) f1 range( a1:d8).cut range( f1) a1 d8f1 range( a1).currentregion.copy sheets( sheet2).range( a1) a1 2 a1 currentregion (39) activewindow.rangeselection.value=xx xx (40) activewindow.rangeselection.count (41) selection.count (42) getaddress=replace(hyperlinkcell.hyperlinks(1).address,mailto:,) (43) textcolor=range( a1).font.colorindex 鵥a1 range( a1).interior.colorindex a1 (44) cells.count (45) selection.range( e4).select 3 4 (46) cells.item(5,c) c5 cells.item(5,3) c5 (47) range( a1).offset(rowoffset:=4,columnoffset:=5) range( a1).offset(4,5) f5 (48) range( b3).resize(rowsize:=11,columnsize:=3) rnage( b3).resize(11,3) b3d13 (49) range( data).resize(,2) data 2 (50) union(range( data1),range( data2) data1 data2 (51) intersect(range( data1),range( data2) data1 data2 (52) range( data).count data range( data). columns.count data range( data). rows.count data (53) selection.columns.count selection.rows.count (54) selection.areas.count (55) activesheet.usedrange.row (56) rng.column rng (57) activesheet.cells.specialcells(xlcelltypeallformatconditions) - 3 - - page 4- excelvbavba 伯 (58) range( a1).autofilter field:=3,visibledropdown:=false 3 (59) range( a1c3).name= computer a1c3 computer range( d1e6).name= sheet1!book sheet1 d1 e6 book names( computer).name= robot computer robot (60) names( book).delete (61) names.add name:= contentlist_ refersto:= =offset(sheet1!a2,0,0,counta(sheet2!$a:$a) (62) names.add name:= company,refersto:= companycar companycar (63) names.add name:= total,refersto:=123456 123456 total (64) names.add name:= myarray,refersto:=arraynum arraynum myarray (65) names.add name:= producenum,refersto:= =$b$1,visible:=false (66) activeworkbook.names( com).name (67) application.worksheetfunction.isnumber( a1) a1 (68) range( a:a).find(application.worksheetfunction.max(range( a:a).activate a (69) cells(8,8).formulaarray= =sum(r2c-1:r-1c-1*r2c:r-1c) 鹫r1c1 (70) activesheet.chartobjects.count (71) activesheet.chartobjects( chart1).select chart1 (72) activesheet.chartobjects( chart1).activate activechart.chartarea.select - 4 - - page 5- excelvbavba 伯 (73) worksheets( sheet1).chartobjects( chart2).chart. _ chartarea.interior.colorindex=2 (74) sheets( chart2).chartarea.interior.colorindex=2 (75) charts.add (76) activechart.setsourcedata source:=sheets( sheet1).range( a1:d5), _ plotby:=xlcolumns (77) activechart.location where:=xllocationasnewsheet (78) activechart.plotarea.interior.colorindex=xlnone (79) worksheets( sheet1).chartobjects(1).chart. _ export filename:= cmychart.gif,filtername:= gif 1 c mychart.gif (80) msgbox hello! hello (81) ans=msgbox( continue?,vbyesno) ans vbyesans vbno if msgbox( continue?,vbyesno)vba 伯 (92) application.enableevents=false application.enableevents=true (93) set excelsheet = createobject(“excel.sheet“) excel excelsheet.application.visible = true application excel excelsheet.application.cells(1, 1).value = “data“ excelsheet.saveas “c:test.xls“ 浽c:test.xls excelsheet.application.quit excel set excelsheet = nothing (94) excel dim xlapp as excel.application dim xlbook as excel.workbook dim xlsheet as excel.worksheet set xlapp = createobject(“excel.application“) set xlbook = xlapp.workbooks.add set xlsheet = xlbook.worksheets(1) (95) excel.application call mysub (createobject(“excel.application“) (96) set d = create

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论