cegeland
asked on
Macro: Inserting a new row, keep the formatting - change fill for one cell
Hi!
Attached I have a macro for inserting a new row into a spreadsheet. This works fine but I would like the macro to preset the cell i column K with a fill color (using RGB value). This fill color will later be changed by a macro running in Worksheet_change.
Thanks!
Attached I have a macro for inserting a new row into a spreadsheet. This works fine but I would like the macro to preset the cell i column K with a fill color (using RGB value). This fill color will later be changed by a macro running in Worksheet_change.
Thanks!
Sub InsertARow()
'make new row
ActiveCell.EntireRow.Insert shift:=xlUp
'copy the row above
ActiveCell.Offset(1, 0).EntireRow.Copy Cells(ActiveCell.Row, 1)
On Error Resume Next
'clear every cell in the new line that does not have a formula
ActiveCell.EntireRow.SpecialCells(xlCellTypeConstants, 23).ClearContents
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.