"macro" - > "Vi" /> "macro" - > "Vi" />

全文预览

office 办公软件中利用VBA(Visual Basic for Application)宏(办公室办公软件中利用VBA(Visual Basic for Application)宏)

上传者:幸福人生 |  格式:doc  |  页数:9 |  大小:31KB

文档介绍
xel, I didn't find the ability to change rows, columns, columns, and so on, so I wrote a macro.РExample three: rows are converted into columns in Exel. In the Exel from the "tools" - > "macro" - > "Visual Basic editor open programming environment, through the" insert "- >" module ", the establishment of a macro.РSub change ()'change macroРDim row (0, To, 20, 0, To, 20) As String 'defines a two-dimensional array of 21*21РRange ("A1").Select "select the A1 cellРFor I = 0, To 20РFor J = 0, To 20РRow (I, J) = ActiveCell.Offset (I, J).Value 'takes the value of the cells in the cells of the A1 shift (I, J) to the array row (I, J) in turnРNext JРNext IРRange ("A1").SelectРOn Error GoTo errРFor I = 0, To 20Р对于j = 0到20Р当前活动(i,j)。偏移。值=行(j,i)”把数组行(J,I)的内容依次附值给A1位移(i,j)个单元格的单元格Р下JР下一个我Р退出子Р犯错:Р显示错误Р端子

收藏

分享

举报
下载此文档