Hi everyone.
This macro appends 2 rows after the non-blank rows at the end.
can I change to increase the rows to 4?
thank you
john
This macro appends 2 rows after the non-blank rows at the end.
can I change to increase the rows to 4?
Code:
Option Explicit
Sub aggiungi_copiaformato_new()
On Error Resume Next
Dim n As Long
Dim x As Long
ActiveSheet.Unprotect "987654"
Dim uR As Long
uR = Cells(Rows.Count, 2).End(xlUp).Row
Range(Cells(uR - 1, 1), Cells(uR, 1)).EntireRow.Copy
Application.EnableEvents = False
Cells(uR + 1, 1).PasteSpecial Paste:=xlFormats
Range("B" & Rows.Count).End(xlUp).Offset(-1).Resize(2, 16).ClearContents
Application.EnableEvents = True
Application.CutCopyMode = False
'Application.Goto ActiveCell, scroll:=True
ActiveSheet.Protect "987654"
End SubOption Explicit
Sub aggiungi_copiaformato_new()
On Error Resume Next
Dim n As Long
Dim x As Long
ActiveSheet.Unprotect "987654"
Dim uR As Long
uR = Cells(Rows.Count, 2).End(xlUp).Row
Range(Cells(uR - 1, 1), Cells(uR, 1)).EntireRow.Copy
Application.EnableEvents = False
Cells(uR + 1, 1).PasteSpecial Paste:=xlFormats
Range("B" & Rows.Count).End(xlUp).Offset(-1).Resize(2, 16).ClearContents
Application.EnableEvents = True
Application.CutCopyMode = False
'Application.Goto ActiveCell, scroll:=True
ActiveSheet.Protect "987654"
End Sub
thank you
john