我希望有人可以帮助我解决这个问题。我正在寻找A列中第一个非空白单元格的合并范围。我在该列中找到了具有该值的最后一个单元格,但是出于合并目的,我需要在下面添加一个单元格,如何实现呢?
Sub mergeCells()
Dim rng As Range
Set rng = Cells.Find(what:="*", after:=Cells(2),
searchdirection:=xlPrevious, searchorder:=xlByColumns)
s = ActiveCell.Offset(-1, -1).Address 'one cell above current one
MsgBox rng.Activate + 1
End Sub
答案 0 :(得分:1)
使用此:
Sub mergeCells()
Dim rng As Range
Set rng = Cells.Find(what:="*", after:=Cells(1), searchdirection:=xlPrevious, searchorder:=xlByColumns)
MsgBox rng.Offset(1, 0).Address
End Sub