Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to Copy Var. Ranges to Var. Rows | Excel Discussion (Misc queries) | |||
Copy ranges into email - HTLM and Text format | Excel Discussion (Misc queries) | |||
Copy ranges into email - HTLM and Text format | Excel Programming | |||
Using macro/vba to copy varying ranges of rows | Excel Discussion (Misc queries) | |||
delete rows when value is within an interval in col 3 | Excel Programming |