Here is some code that I have been using sucsessfully to add formatting to the next 10 rows at the end of the current sheet. The formatting is is row 2 and that row is hidden. All of a sudden I am getting a "runtime error 1004 no cells were found." Nothing that I can find has changed that would cause it to stop working.
Column "A - G" contains formulas
Column "H" contains data
If i pull out the
paste it into a new module and change it to
it will find the cell below the last cell with data which is what I need it to do only in column A
Any suggestions??
Thanks in advance for the help
Column "A - G" contains formulas
Column "H" contains data
If i pull out the
Code:
Range("a9:a" & Rows.Count).SpecialCells(xlBlanks)(1).PasteSpecial Paste:=xlPasteAll
paste it into a new module and change it to
Code:
Range("H9:H" & Rows.Count).SpecialCells(xlBlanks)(1).PasteSpecial Paste:=xlPasteAll
it will find the cell below the last cell with data which is what I need it to do only in column A
Code:
Private Sub Add_Rows()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
ActiveSheet.UnProtect
Range("A2:x2").Copy
Range("a9:a" & Rows.Count).SpecialCells(xlBlanks)(1).PasteSpecial Paste:=xlPasteAll
Range("a9:a" & Rows.Count).SpecialCells(xlBlanks)(1).PasteSpecial Paste:=xlPasteAll
Range("a9:a" & Rows.Count).SpecialCells(xlBlanks)(1).PasteSpecial Paste:=xlPasteAll
Range("a9:a" & Rows.Count).SpecialCells(xlBlanks)(1).PasteSpecial Paste:=xlPasteAll
Range("a9:a" & Rows.Count).SpecialCells(xlBlanks)(1).PasteSpecial Paste:=xlPasteAll
Range("a9:a" & Rows.Count).SpecialCells(xlBlanks)(1).PasteSpecial Paste:=xlPasteAll
Range("a9:a" & Rows.Count).SpecialCells(xlBlanks)(1).PasteSpecial Paste:=xlPasteAll
Range("a9:a" & Rows.Count).SpecialCells(xlBlanks)(1).PasteSpecial Paste:=xlPasteAll
Range("a9:a" & Rows.Count).SpecialCells(xlBlanks)(1).PasteSpecial Paste:=xlPasteAll
Range("a9:a" & Rows.Count).SpecialCells(xlBlanks)(1).PasteSpecial Paste:=xlPasteAll
Range("h9:h" & Rows.Count).SpecialCells(xlBlanks)(1).Select
Selection.Activate
ActiveSheet.Protect
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
Any suggestions??
Thanks in advance for the help