LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Put in clipboard, but keep the current content

Hello group,

I have a userform to add or edit comments and progress reports regarding a
project my team is working on.
There is a button to insert the date (in square brackets) in the textbox
where the cursor happens to be. There are 3 textboxes.

I have this code that formats the date, puts it in the clipboard, and
pastes it into the textbox:

Dim Date1 As New DataObject
Date1 .SetText "[" & Format(Date, "dd/mm/yy") & "] "
Date1 .PutInClipboard
Application.SendKeys ("^v")

Howecer, by copying to the clipboard, I wipe whatever is there previously.
In some cases this is very inconvenient.

Is there a way to store the contents of the clipboard somewhere, perform
this action, and then put the previous contents back in the clipboard?
My attempts to put some GetFromClipboard and PutInClipboard lines in series
were unsuccessful. Only the first action seems to get through. Or the second
gets put into a second clipboard instance, which I don't know how to
address.
Is there a way to address a specific clipboard instance, so that after
pasting the date, i can still use Ctrl + V to paste whatever I copied
earlier into the form?
Or is there a way to reference the active textbox and enter the formatted
date directly at the top left, without going via the clipboard?

Any assistance would be appreciated.

Eric


 
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
Where does Ms XL store the clipboard ? or where does MS Windowsstore clipboard ? Subu Setting up and Configuration of Excel 1 May 18th 09 06:56 AM
Where does Ms XL store the clipboard ? or where does MS Windowsstore clipboard ? Subu Setting up and Configuration of Excel 0 May 5th 09 01:20 PM
Clipboard empty but still get waring that clipboard is full Steve Excel Discussion (Misc queries) 0 June 17th 08 09:05 PM
Copy current row to clipboard and delete row GKW in GA Excel Discussion (Misc queries) 4 April 19th 08 06:37 PM
How to transpose formulas from column content to row content. Notrom Excel Worksheet Functions 1 October 12th 06 06:57 PM


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