I am a newbie to this and have received really good help with two macros today. However, I prematurely logged the problem as closed.
I have a macro to insert a new line in a block of cells that appears multiple times and another macro that duplicates the block, including the insert line button. Initially it seemed to be fine but now the insert line button inserts multiple lines at the top of the sheet and it seems to be copying them from somewhere else in the sheet? I suspect that I have done something stupid in not separating the two pieces of code in the macro editor properly? I also get a strange message saying "The picture is too large and will be truncated" - picture? What picture?
File attached and I have shown the code below, thanks in advance!
RDS
Sub InsertRow()
'
' InsertRow Macro
'
' Keyboard Shortcut: Ctrl+Shift+I
'
If Not IsError(Application.Caller) Then
ActiveSheet.Shapes(Application.Caller).TopLeftCell.Select
End If
Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove
ActiveCell.Offset(-3, 10).Range("A1:C3").Select
Selection.AutoFill Destination:=ActiveCell.Range("A1:C6"), Type:= _
xlFillDefault
ActiveCell.Range("A1:C6").Select
ActiveCell.Offset(2, 3).Range("A1").Select
Selection.AutoFill Destination:=ActiveCell.Range("A1:A2"), Type:= _
xlFillDefault
ActiveCell.Range("A1:A2").Select
End Sub
Sub InsertIssue()
'
' InsertIssue Macro
'
Dim rngFrom As Range
Dim rngTo As Range
Set rngFrom = ThisWorkbook.Worksheets("InsertTemplate").Range("5:11")
Set rngTo = ActiveSheet.Cells(ActiveSheet.Rows.Count, 3).End(xlUp).Offset(1)
rngFrom.Copy rngTo.EntireRow
rngTo.FormulaR1C1 = "=R[-1]C[13]+1"
' Intersect(rngTo.MergeArea.EntireRow, ActiveSheet.Range("G:K")).ClearContents
End Sub
Bookmarks