我已经看到很多帖子从上面的单元格填充空白单元格。但这是相反的事情。在这里,我们可以从下面的单元格填充空白单元格。
当前
A1 = blank
A2 = blank
A3 = blank
A4 = data
希望:
A1 = data from A4
A2 = data from A4
A3 = data from A4
A4 = data
答案 0 :(得分:0)
<强>解决方案:强>
1. Select A1:A3
2. Press Enter till the active cell become A3 (just before/above the required value)
3. Enter "=" (without quotes)
4. Press the Down cursor key once/Select the below cell value
5. Press Ctrl+Enter
同样对于完整专栏,我们可以通过传统的Excel技术和选项:
1. Select the Column where you need to fill the blanks
2. Home -> Find & Select -> Select Blank Function(it will select all the blanks in your selection)
3. Now hit enter until reach a cell which is just before the required cell value.
4. Press "="
5. Press the Down key once / Select the below cell value
6. Hit: Ctrl + Enter
答案 1 :(得分:0)
如果您事先知道 A4 是要向上复制的单元格,那么:
Sub FillCells()
Range("A1:A3").Value = Range("A4").Value
End Sub
如果您不知道填充了哪个单元格,那么:
Sub FillCells2()
Dim N As Long
N = Cells(Rows.Count, 1).End(xlUp).Row
Range("A1:A" & N - 1).Value = Range("A" & N).Value
End Sub
答案 2 :(得分:0)
答案 3 :(得分:0)
填写 - 并处理单独的空白区域:
Sub FillUp()
Dim rng1 As Range
On Error Resume Next
Set rng1 = Range([a1], Cells(Rows.Count, "A").End(xlUp)).SpecialCells(xlBlanks)
On Error GoTo 0
If rng1 Is Nothing Then Exit Sub
rng1.FormulaR1C1 = "=R[1]C"
rng1.Value = rng1.Value
End Sub