ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get text from clipboard (https://www.excelbanter.com/excel-programming/347148-get-text-clipboard.html)

Rene Petersen

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



chijanzen

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



Tom Ogilvy

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





Tony Jollans

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





Doug Robbins - Word MVP[_3_]

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






All times are GMT +1. The time now is 03:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com