LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 4
Default Excel2000...use Ctrl-V, not Paste, in macro to Format Axis in

Nick,

I am having trouble with SendKey. I run Excel2000 in XP SP2.

Rather than mess with using SendKey to paste (^v) in my chart, I came up
with a little macro to simply enter a value (151) into cell A1, but receive a
compile error.

Here's my code ...

Sub SKeys()
'
' SKeys Macro
' Macro recorded 3/23/2007 by MacroPete
'
' Keyboard Shortcut: Ctrl+Shift+S
'
Range("A1").Select
ActiveCell.FormulaR1C1 = Application.SendKeys("151")
Range("A2").Select
End Sub
************************

I also tried ... ActiveCell.FormulaR1C1 = SendKeys("151")

and received the same compile error.

Might you correct my above code?

My thinking is that once I get SendKey to work re the above, I'll get it
working in my chart.

Thank you very much.

"Nick Hodge" wrote:

MacroPete

You can replace the paste line with a sendkeys method/statement like so

Application.SendKeys ("^v") 'Excel's method
SendKeys("^v") 'VBA's statement

Caution: You may find if using this on Windows Vista with Excel versions
before Excel2007 that the Excel method will not work with Vista's UAC (User
Access Control) switched on (default). The VBA statement will work. Both
will work in Excel 2007 (go figure)

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
www.nickhodge.co.uk


 
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
make paste values only a ctrl-key? Ian Elliott Excel Discussion (Misc queries) 2 April 17th 09 04:01 PM
How to set up a repeating macro to sum values in Excel2000? crankypants in Washington Excel Discussion (Misc queries) 2 October 23rd 06 09:41 PM
why does ctrl+v paste an image of the screen? GingerMagician Excel Discussion (Misc queries) 0 April 16th 06 03:21 PM
How to assign Ctrl+Shift+Insert to Paste Values? [email protected] Excel Discussion (Misc queries) 5 October 3rd 05 10:43 PM
Problem with delays in Cut (Cntl-C) and Paste (Ctrl-V) in Excel Girl from Tacoma Excel Discussion (Misc queries) 0 December 10th 04 02:55 AM


All times are GMT +1. The time now is 02:18 AM.

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

About Us

"It's about Microsoft Excel"