vba

乘积练习-vab

Sub 乘积练习() Dim i% For i = 1 To UsedRange.Rows.CountActiveSheet.Cells(i, 3) = ActiveSheet.Cells(i, 1) * ActiveSheet.Cells(i, 2) Next End Sub ][1] 关键字:vba, cells, sub, dim

合并单元格实例操作

帮我熟悉:获取行数的公式:usedrange.rows.countoffset/risize/merge等函数的使用。Sub 合并单元格() Application.DisplayAlerts = False Dim i%, k% i = UsedRange.Rows.Count For k = i To 2 Step -1If Cells(k, 1) = Cells(k,

查找最后一个单元格的两种方法

找行和列的方法 Sub 最后一个单元格()Dim a%, b% a = ActiveSheet.UsedRange.Rows.Count b = ActiveSheet.UsedRange.Columns.Count MsgBox Cells(a, b).Address & "是最后一个单元格"End Sub 用find函数的方法 Sub 最后一个单元格2()Dim rng

查询系统-vba

Sub 查询系统() Range("h2:k999").ClearDim a%, m% m = 2 'a = Columns(1).Find("*", , , , , , , xlPrevious).Row For i = 1 To 10If Cells(i, 1) Like [h1] ThenRange("a" & i & ":d" & i).Copy Cells(m,