msquared99
Board Regular
- Joined
- Mar 8, 2012
- Messages
- 52
I have a spreadsheet that has a name starting in cell A2, then there are 5 blanks, a name (Cell A8), 5 blanks, a name (cell A14), 5 blanks and so on. I want my macro to place the name above into the 5 blanks below to the end of the spreadsheet.
The code I have places the name in all the blanks in all the columns. I only need the name in column A.
Thanks for any help!
Here is the code:
Sub FillIn()
On Error Resume Next
Range("A2").CurrentRegion.SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R[-1]C1"
Range("A2").CurrentRegion.Value = Range("A2").CurrentRegion.Value
End Sub
The code I have places the name in all the blanks in all the columns. I only need the name in column A.
Thanks for any help!
Here is the code:
Sub FillIn()
On Error Resume Next
Range("A2").CurrentRegion.SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R[-1]C1"
Range("A2").CurrentRegion.Value = Range("A2").CurrentRegion.Value
End Sub