VBA找到最后的单元格

a = Cells(Rows.Count, 1).End(xlUp).Row 'end属性
b = Columns(1).Find("*", , , , , xlPrevious).Row 'find方法
c = Cells.SpecialCells(xlCellTypeLastCell).Row 'specialcells方法
d = Sheet1.UsedRange.Rows.Count 'usedrange属性
e = [a1].CurrentRegion.Rows.Count 'currentregion属性
f = WorksheetFunction.CountA([a:a]) '工作表函数counta
g = Application.CountIf([a:a], "<>") '工作表函数countif


Sub 连接符单元格连接()
Dim rng As Range
For Each rngs In [b2:b10]
    adss = rngs.Address
    ads = ads & rngs.Address & ","
Next
    ad = Left(ads, Len(ads) - 1)
End Sub

Sub union单元格连接()
Dim rng As Range, rngs As Range
Set rng = [b2]
For Each rngs In [b2:b10]
    adss = rngs.Address
    Set rng = Union(rng, rngs)
    ads = rng.Address
Next
End Sub

Sub 隔行插入()
For i = 0 To Application.CountA(Columns(1)) * 2 Step 2
Intersect([a1:d2].Offset(i), [a2:d3].Offset(i)).EntireRow.Insert
Next

End Sub


···

你可能感兴趣的:(VBA找到最后的单元格)