Computing.Net > Forums > Programming > excel macro help!

excel macro help!

Reply to Message Icon

Original Message
Name: kinetic
Date: November 26, 2007 at 14:24:54 Pacific
Subject: excel macro help!
OS: xp
CPU/Ram: 2g
Model/Manufacturer: ibm
Comment:

hello.

i am trying to copy multiple columns from a spreadsheet and paste them into an email.. everything is working.. except its grabbing columns i dont want

Set a = Range("A13:A15")
Set b = Range("E13:E15")
Set c = Range("F13:F15")
Union(a, b, c).Select

Selection.Copy

Set ClipBoard = New DataObject
ClipBoard.GetFromClipboard
SaveIt = True

-it's grabbing columns B, C and D

i also tried

range("a13:a15,e13:e15,f13:f15").select

which also grabs columns b,c, and d.

can anyone help?


Report Offensive Message For Removal


Response Number 1
Name: Razor2.3
Date: November 26, 2007 at 20:31:31 Pacific
Reply: (edit)

I'm not sure what you're tring to do, but

Range("a13:a15,e13:f15").Select
is working perfectly for me.

The clipboard, however, does not retain the "empty" space between the columns, so pasting over the data on A13 would replace the data in A13:C15, and not A13:A15,E13:F15.


Report Offensive Follow Up For Removal

Response Number 2
Name: kinetic
Date: November 29, 2007 at 08:42:11 Pacific
Reply: (edit)

ur right! i tried the code on a test copy of a db and it worked.. so something in what im using is messing things up... ill have a closer look..

thanks for the clearup!


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: excel macro help!

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge