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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
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,215,641
Messages
6,125,982
Members
449,276
Latest member
surendra75

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