Thread: 2 Macros
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_4_] Rob van Gelder[_4_] is offline
external usenet poster
 
Posts: 1,236
Default 2 Macros

Leandrocg,

You can't repeat it the same procedure.

Try putting conditional logic into your code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("A1") Then
'Something with A1
ElseIf Target = Range("B1") Then
'something with B1
Else
'something else
End If
End Sub

Rob


"leandrocg " wrote in message
...
i know that must have a very obvious solution but,
how do i use two same macros in a sheet?
ex. i use Worksheet_Change

and later Worksheet_Change again
but excel says "repeated name found: Worksheet_Change"

i would like to use Worksheet_Change twice with different properties,
how would i do it?


---
Message posted from http://www.ExcelForum.com/