第一题:
'想法:先找到非空,然后非空行再与A列取交集。
Sub job5()
Dim rg As Range
Dim rs As Range
Dim rm As Range
Set rg = Worksheets("练习11").Range("A1:D12").SpecialCells(xlCellTypeConstants) '选中非空
Set rs = rg.EntireRow '选中非空所在的行
Set rm = Application.Intersect(Columns(1), rs) '将非空所在行与A列取交集
rm = 1
Sub 题目一()
Dim i, j
With Range("c4").CurrentRegion
i = .Rows.Count
j = .Columns.Count
[d15] = .Range("a1").Offset(i - 1, j - 1).Address(0, 0)
End With
End Sub
Sub 题目二()
Dim i, j
With Range("d3")
i = .Left
j = .Width
End With
Range("f3").Comment.Shape.Left = i + j
End Sub