Insert Row Below, then Copy and Paste from Named Range
8 views
Skip to first unread message
David Godinger
unread,
Dec 21, 2021, 1:28:29 PM12/21/21
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I'm attempting VBA that will
1) Insert a row BENEATH the current one
2) Copy a named range into the new row
In the following code, part 1) already works, but part 2) doesn't get me the content or format of the named range. Here's what I've cobbled together so far:
Sub insertRowUpWide()
'1) THIS WORKS: Insert row below
Dim xRg As Range
On Error Resume Next
Set xRg = ActiveCell.Offset(1, 0)
xRg.EntireRow.Select
Selection.Insert Shift:=xlDown
Selection.ClearFormats
Application.ScreenUpdating = True
'2) THIS DOES NOT WORK: Paste from named range
Range("rowToInsertWide").Copy
ActiveSheet.Paste