Excel VBA macro to paste multiple ranges

_Pat_S

New Member
Joined
Jul 17, 2019
Messages
1
Hi, I have found a macro that I was able to modify and use and (sort of) understand, but for the life of me I can't figure out how to do the next step for what I am attempting.

https://www.rondebruin.nl/win/s1/outlook/bmail2.htm

Above is what I am using - I am using 'find last row' to define the value and that part works. The main part of the macro works, all hunky dory.

What I am trying to do is have a named range in every email that doesn't change (essentially the header for my document).

So what it currently does, is pasts the last row of the document, columns A:O.

What I am trying to figure out is possible, is if it can do the first row (A1:O1) in addition to that last row. It feels like it should be simpler than I am making it. Been messing around with it for hours but haven't had much luck.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
with the named range of Headers, try
Code:
Set rng = Union(Range("Headers"), Range("A" & lr & ":O" & lr)).SpecialCells(xlCellTypeVisible)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top