Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Copy two ranges without the interval rows to the email

Hi,

what i intend to do is that i just want to copy two
ranges(range("A1:L2"),rng2=("A5:L5")) from excel to an email.
i use the vba as below:
union(range("A1:L2"),rng2=("A5:L5")).copy
it can get the right result in the excel,while i paste it in the email it
display the whole range("a1:l5").
i am very confused about why it get the different result£¿

can anybody give a guide?

Regards,
Chelsea


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Copy two ranges without the interval rows to the email

To help debug these type problems I sometimes resort to SELECTION.

I would do
union(range("A1:L2"),rng2=("A5:L5")).select

Then look at the worksheet to see what is selected.

Then try

set CopyRange = union(range("A1:L2"),rng2=("A5:L5"))
CopyRange.Select

And see if the same results occur. If this is correct then you can replace
your code with

set CopyRange = union(range("A1:L2"),rng2=("A5:L5"))
CopyRange.Copy



"chelsea" wrote:

Hi,

what i intend to do is that i just want to copy two
ranges(range("A1:L2"),rng2=("A5:L5")) from excel to an email.
i use the vba as below:
union(range("A1:L2"),rng2=("A5:L5")).copy
it can get the right result in the excel,while i paste it in the email it
display the whole range("a1:l5").
i am very confused about why it get the different result£¿

can anybody give a guide?

Regards,
Chelsea



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Copy two ranges without the interval rows to the email

I just noticed the rng2. I think this should be

from
union(range("A1:L2"),rng2=("A5:L5")).copy

to
union(range("A1:L2"),rng2:=Range("A5:L5")).copy

or just
union(range("A1:L2"),range("A5:L5")).copy


"chelsea" wrote:

Hi,

what i intend to do is that i just want to copy two
ranges(range("A1:L2"),rng2=("A5:L5")) from excel to an email.
i use the vba as below:
union(range("A1:L2"),rng2=("A5:L5")).copy
it can get the right result in the excel,while i paste it in the email it
display the whole range("a1:l5").
i am very confused about why it get the different result£¿

can anybody give a guide?

Regards,
Chelsea



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to Copy Var. Ranges to Var. Rows Cmims Excel Discussion (Misc queries) 0 November 3rd 09 08:33 PM
Copy ranges into email - HTLM and Text format fLiPMoD£ Excel Discussion (Misc queries) 2 November 7th 07 01:59 PM
Copy ranges into email - HTLM and Text format fLiPMoD£ Excel Programming 2 November 7th 07 01:59 PM
Using macro/vba to copy varying ranges of rows BCLivell Excel Discussion (Misc queries) 3 June 6th 07 02:52 PM
delete rows when value is within an interval in col 3 sverre Excel Programming 5 October 27th 06 01:20 PM


All times are GMT +1. The time now is 01:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"