我的表是这样的:
| A | B | ...
---------
| 1 | a | ...
---------
| 2 | |
---------
| 3 | |
---------
| 4 | b |
---------
我想要这个作为我的输出:
| A | B | ...
---------
| a | | ...
---------
| 2 | |
---------
| 3 | |
---------
| b | |
---------
所以我正在循环列B
,只要有一个值,B
我就应该替换相应的A
到目前为止,我已经尝试过这样的:
Sub LoopRange()
Dim rCell As Range
Dim rRng As Range
Set rRng1 = Sheet1.Range(A1, A1000)
Set rRng2 = Sheet1.Range(B1, B1000)
For Each rCell In rRng2.Cells
If Not IsEmpty(rCell.Value) Then
'SET THE VALUE OF THIS rCELL TO THE CELL THAT'S LEFT OF IT
Next rCell
End Sub
我该怎么做呢?