Excel 用空格下方下一个值的值填充空白单元格 我看到很多帖子从上面的单元格中填充空白单元格。但这里有相反的东西。这里我们可以从下面的细胞中填充空白细胞。< /P>
当前:Excel 用空格下方下一个值的值填充空白单元格 我看到很多帖子从上面的单元格中填充空白单元格。但这里有相反的东西。这里我们可以从下面的细胞中填充空白细胞。< /P>,excel,excel-formula,vba,Excel,Excel Formula,Vba,当前: A1 = blank A2 = blank A3 = blank A4 = data A1 = data from A4 A2 = data from A4 A3 = data from A4 A4 = data 1. Select A1:A3 2. Press Enter till the active cell become A3 (just before/above the required value) 3. Enter "=" (without quotes) 4. Pre
A1 = blank
A2 = blank
A3 = blank
A4 = data
A1 = data from A4
A2 = data from A4
A3 = data from A4
A4 = data
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
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
希望:
A1 = blank
A2 = blank
A3 = blank
A4 = data
A1 = data from A4
A2 = data from A4
A3 = data from A4
A4 = data
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
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
解决方案:
A1 = blank
A2 = blank
A3 = blank
A4 = data
A1 = data from A4
A2 = data from A4
A3 = data from A4
A4 = data
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
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
同样,对于完整列,我们可以使用传统的excel技术和选项:
A1 = blank
A2 = blank
A3 = blank
A4 = data
A1 = data from A4
A2 = data from A4
A3 = data from A4
A4 = data
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
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
如果您事先知道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
填充和处理单独的空白区域:
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
到目前为止你试过什么?