I have a range c2:g16. Some are filled with numbers and the others are just blank cells. I would like a macro that will insert a letter A into the blank cells. Thank you.
I have a range c2:g16. Some are filled with numbers and the others are just blank cells. I would like a macro that will insert a letter A into the blank cells. Thank you.
You can use the macro recorder as a starting point (Macro1)
BUT you always need to clean up the recorded code (Macro1_Editied) to make it more efficient and maintainable
[VBA]
Sub Macro1()
Range("C2:G16").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = "A"
Range("C2").Select
End Sub
Sub Macro1_edited()
On Error Resume Next
ActiveSheet.Range("C2:G16").SpecialCells(xlCellTypeBlanks).Value = "A"
On Error GoTo 0
End Sub
[/VBA]
Paul
That worked. Thanks.