ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying discontiguous ranges to Word (https://www.excelbanter.com/excel-programming/348171-copying-discontiguous-ranges-word.html)

Garry[_8_]

Copying discontiguous ranges to Word
 
Hi All:

Thanks from this newbie to previous helpers. Current problem: I am
trying to copy two discontiguous rectangular ranges to Word. Doing this
manually with ctrl-click works just fine.

Problem 1: I have a range say "$F$42:$F$51,$H$42:$H$51" in MyRange
(note that column G is not included), created by a Union command. A
call to myRange.Copy ends up with error 4001 "Cannot change merged
cell". True, the second range does have merged cells, but I'm stuck
with them.

However if I do MyRange.Select then Selection.Copy, there is no error
and it works (sort of-- see below). Any idea why?

Now to Problem 2: When I paste the selection into Word, I get all the
columns between the two ranges, so I get in effect "$F$42:$H$51". Any
suggestions?

As ever, thanks for your time
Garry



All times are GMT +1. The time now is 05:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com