ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can I default to Paste Special? (https://www.excelbanter.com/excel-programming/318767-how-can-i-default-paste-special.html)

Flop

How can I default to Paste Special?
 
I have created a spreadsheet to be used by my staff for inputing data. Many
of the cells have formulas in them that are protected. However, occasionally
my staff will cut and paste or copy and paste cells from one row or colum to
another, creating errors in the spreadsheet becuase the formula follows. Is
there a way to automatically have the sheet use Paste=Special when the
copy=paste function is used?

Thanks in advance to anyone who may have some input on this...

Frank Kabel

How can I default to Paste Special?
 
Hi
AFAIK not possible. But you could record a macro while using paste special
and assign a shortcut for this macro

--
Regards
Frank Kabel
Frankfurt, Germany
"Flop" schrieb im Newsbeitrag
...
I have created a spreadsheet to be used by my staff for inputing data.

Many
of the cells have formulas in them that are protected. However,

occasionally
my staff will cut and paste or copy and paste cells from one row or colum

to
another, creating errors in the spreadsheet becuase the formula follows.

Is
there a way to automatically have the sheet use Paste=Special when the
copy=paste function is used?

Thanks in advance to anyone who may have some input on this...




Don Guillett[_4_]

How can I default to Paste Special?
 
You could actually use a worksheet change event to create your formula
values. Then, there is no formula left to copy, just values. Right click
sheet tabview codecopy this example.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 1 Or Target.Row < 2 Then Exit Sub
Target.Offset(0, 1) = Target * 3.34
End Sub
--
Don Guillett
SalesAid Software

"Flop" wrote in message
...
I have created a spreadsheet to be used by my staff for inputing data.

Many
of the cells have formulas in them that are protected. However,

occasionally
my staff will cut and paste or copy and paste cells from one row or colum

to
another, creating errors in the spreadsheet becuase the formula follows.

Is
there a way to automatically have the sheet use Paste=Special when the
copy=paste function is used?

Thanks in advance to anyone who may have some input on this...




Peter T

How can I default to Paste Special?
 
Couple of ideas for you. Neither very satisfactory and wouldn't want them
myself, but maybe of use for you. Paste into the ThisWorkbook module

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
Dim retval
If Application.CutCopyMode < False Then
''''''''''''''''
'''''method 1
'retval = Application.Dialogs(xlDialogPasteSpecial).Show(3)
'If retval = False Then Application.CutCopyMode = False
''''''''''''''''

'''''''''''''''
'''''Method 2
retval = MsgBox("Yes: Paste values & Formats" & vbCr & _
"No: Paste values only", vbYesNoCancel, _
"Paste special No Undo")
If retval < vbCancel Then
Selection.PasteSpecial Paste:=xlValues
If retval = vbYes Then
Selection.PasteSpecial Paste:=xlFormats
End If
Else
SendKeys "{Esc}", True
End If
'''''''''''''''''
End If
End Sub


Regards,
Peter

"Flop" wrote in message
...
I have created a spreadsheet to be used by my staff for inputing data.

Many
of the cells have formulas in them that are protected. However,

occasionally
my staff will cut and paste or copy and paste cells from one row or colum

to
another, creating errors in the spreadsheet becuase the formula follows.

Is
there a way to automatically have the sheet use Paste=Special when the
copy=paste function is used?

Thanks in advance to anyone who may have some input on this...





All times are GMT +1. The time now is 05:32 AM.

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