View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default run macro after paste

It is possible using event code but "some data" needs clarifying.

Copying just data or formulas?

Pasting into one cell or a range of cells?

If a range of cells what would it be?

Variable or fixed range?

Code for one cell if not pasting a formula...................

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo stoppit
Application.EnableEvents = False
If Target.Address = "$A$2" And Not Target.HasFormula Then
MsgBox "a change has been made to A2"
'Call Macroname
End If
Application.CutCopyMode = False
stoppit:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Mon, 27 Oct 2008 12:28:01 -0700, K wrote:

Is it possible to run a macro after pasting some data onto a worksheet