Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.word.vba.general
external usenet poster
 
Posts: 8
Default Get text from clipboard

Can anyone help me on this one please.

I am creating a inputbox and I want the default text of the inputbox to be
the text I just copied.

Dim Search
Search = InputBox("Type your search", "Search", CLIPBOARDTEXTHERE)

Thanks,
Rene


  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.word.vba.general
external usenet poster
 
Posts: 139
Default Get text from clipboard


you can use SendKeys

Range("A1").Copy
Application.SendKeys "^V"
Search = InputBox("Type your search", "Search")

--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"Rene Petersen" wrote:

Can anyone help me on this one please.

I am creating a inputbox and I want the default text of the inputbox to be
the text I just copied.

Dim Search
Search = InputBox("Type your search", "Search", CLIPBOARDTEXTHERE)

Thanks,
Rene


  #3   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.word.vba.general
external usenet poster
 
Posts: 27,285
Default Get text from clipboard

You mihgt want to look at the DataObject in the MSForms 2.0 library:

http://www.cpearson.com/excel/clipboar.htm

Assumes you have copied a text string to the clipboard.

--
Regards,
Tom Ogilvy


"Rene Petersen" wrote in message
...
Can anyone help me on this one please.

I am creating a inputbox and I want the default text of the inputbox to be
the text I just copied.

Dim Search
Search = InputBox("Type your search", "Search", CLIPBOARDTEXTHERE)

Thanks,
Rene




  #4   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.word.vba.general
external usenet poster
 
Posts: 13
Default Get text from clipboard

Have you just copied the text in code yourself? Or are you relying on the
user having done it?

If you've done it on code, you should already know what you've copied. If
you're relying on the user you will have to allow for the fact that they may
not have done it and the clipboard may be empty or may contain non-textual
data (but the DataObject is still probably the thing to use).

--
Enjoy,
Tony


"Rene Petersen" wrote in message
...
Can anyone help me on this one please.

I am creating a inputbox and I want the default text of the inputbox to be
the text I just copied.

Dim Search
Search = InputBox("Type your search", "Search", CLIPBOARDTEXTHERE)

Thanks,
Rene




  #5   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.word.vba.general
external usenet poster
 
Posts: 1
Default Get text from clipboard

See the article "Manipulating the clipboard using VBA" at:

http://www.word.mvps.org/FAQs/Macros...eClipboard.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Rene Petersen" wrote in message
...
Can anyone help me on this one please.

I am creating a inputbox and I want the default text of the inputbox to be
the text I just copied.

Dim Search
Search = InputBox("Type your search", "Search", CLIPBOARDTEXTHERE)

Thanks,
Rene




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
Pasting from clipboard-how to control text-to-columns delimiting stebro Excel Discussion (Misc queries) 1 June 15th 05 05:31 PM
Putting plain text string into clipboard in VBA? Don Wiss Excel Programming 4 May 22nd 05 10:24 AM
Put text on clipboard? Jos Vens[_2_] Excel Programming 13 February 10th 05 10:16 AM
How have text on clipboard reformatted as a cell would be put there? RandyDtg1 Excel Programming 3 June 14th 04 02:17 AM
Copying the text from a text box to the clipboard TonyJeffs Excel Programming 1 August 31st 03 07:48 PM


All times are GMT +1. The time now is 08:54 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"