Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Re : Excel Control-"C" to Copy an ActiveCell

It appears that the following VBA statement,

Application.SendKeys ("^C")

does not copy the ActiveCell (as per intention), but why ?

Please share your experience. Regards.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Re : Excel Control-"C" to Copy an ActiveCell

It does work but it is dependant on exactly what you are doing. For example
if you create a forms button on a worksheet and then attach the following
code to the button then when you click the button, it will copy A1.

Sub test()
Range("A1").Select
Application.SendKeys ("^c")
End Sub

However, if you are in the VBA editor and highlight (select) the line
Range("A1").Select
and then run the code from the VBA editor and then move the cursor to a
blank area of the editor and paste you will see that it has copied the
selected text in the VBA editor.

Out of curiousity why would you want to use Senkeys to copy?

--
Regards,

OssieMac


" wrote:

It appears that the following VBA statement,

Application.SendKeys ("^C")

does not copy the ActiveCell (as per intention), but why ?

Please share your experience. Regards.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Re : Excel Control-"C" to Copy an ActiveCell

OssieMac, Esq.,

Thank you for replying to my query.

Could have used, Range("A1").Copy ......
However, upon pasting onto an external application such as MS-Word,
the cell borders of A1 are copied along thereof. The borders are not
wanted in this case.

SendKeys are intended to imitate the menial tasks of highlighting a
cell's contents Control-C (to copy) ...... and then, switching (via
the Task-Bar of Windows) to MS-Word, placing the cursor where it
should be, press keys Control-V, to paste thereof.

Regards.
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
Selecting "Save As" adds "Copy of" to file name- MS Excel 2007 ronhansen Excel Discussion (Misc queries) 1 November 15th 09 09:33 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Excel "Move or Copy" and "Delete" sheet functions dsiama Excel Worksheet Functions 1 December 28th 07 01:57 PM
Replace(ActiveCell.Formula, "Round(","") not working as expected Dennis Excel Programming 3 May 16th 07 04:49 PM
Scroll Bar missing "Control" tab in "Format Properties" dialog box Peter Rooney Excel Discussion (Misc queries) 5 August 24th 06 05:36 PM


All times are GMT +1. The time now is 08:39 PM.

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"