Intercepting Paste Function

M

MrAlMackay

Is it possible to intercept the paste function.

I've got formatting spreadsheet problems when people paste in data from their
own sheets / word.

What I'd like to be able to do is when they paste it actually invokes the Paste
Special function and pastes as values only (therefore my own formatting will be
in place).

Appreciate any help that you can offer.

Many Thanks, Al Mackay ( (e-mail address removed) )
 
S

steve

Al,
This code returns the state of paste, returns 1 for paste, otherwise it is
0.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
MsgBox Application.CutCopyMode
End Sub

Unfortunately, this is an after-the fact response. What you might try is
If Application.CutCopyMode = 1 then
*code to reformat the cells*
End If
The code could be nothing more than copying the format from cells above
the paste range and pastespecial format.
 
A

Al Mackay

Steve

Thanks for your help on this.

Will try this out.

Many thanks for your time.

Cheers, al.
 
J

Julie

Al,

What about creating a macro that calls for the Special Paste, then attach
the macro to a button. You can then have the button appear and disappear
with the form. You will just have to ask people who use the form to use your
special paste button not the one that they are use to.

Julie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top