Dears,
I'd like to write Macro to Copy values to Empty cells below filled cells in selection
For example: if pic.1 is the input data, I'd like Macro to give me output as in pic.2
Dears,
I'd like to write Macro to Copy values to Empty cells below filled cells in selection
For example: if pic.1 is the input data, I'd like Macro to give me output as in pic.2
[vba]
Public Sub blah()
thecurrent = ""
For x = 2 To ActiveSheet.UsedRange.Rows.Count
If ActiveSheet.Range("a" & x).Formula <> "" Then
thecurrent = ActiveSheet.Range("a" & x).Formula
Else
ActiveSheet.Range("a" & x).Formula = thecurrent
End If
Next x
End Sub
[/vba]
***edit*** forgot to increment variable
***edit 2.0*** i'm retarded today. forgot that i'd used a for not a while... incrementing obviously not necessary
You can use plain Excel (without macros)
1. Set Data >> Filter
2. Set the column "Action" Filter to "Blanks" while "Name" to "NonBlanks"
3. Then in the topmost cell considering it is A3, insert formula like
4. Copy the formula to the last Blank Cell. Excel will adjust the penultimate cell address on its own.=A2
Regards,
--------------------------------------------------------------------------------------------------------
Shrivallabha
--------------------------------------------------------------------------------------------------------
Using Excel 2016 in Home / 2010 in Office
--------------------------------------------------------------------------------------------------------
Thanks Sean, that's exactly what I'm looking for..
no problem, glad to help