Is there another way of finding if cells change in a worksheet other than the following?

Private Sub Worksheet_Change(ByVal Target as Range) 
 If Target.Address=$A$1 Then
 End If
End Sub

What I'm particularly interested in is if there's a way of checking without Target in the brackets at the beginning, as in, I would need a code with the Private Sub() End Sub structure (nothing in the brackets is required for my code because I want to make a button with this function).

  • "if there's a way of checking without declaring Target in the brackets at the beginning" - you don't declare it, it's part of the information you receive. What other way would you need? – Máté Juhász Feb 14 at 12:45
  • @MátéJuhász i would need to have a 'Private Sub() End Sub' code. it is required to have nothing in the brackets at the beginning – anne Feb 14 at 12:48
  • 2
    why would you need to have that? it seems to be an xy problem – Máté Juhász Feb 14 at 12:53
  • @MátéJuhász because i want to make a button that uses this function and buttons don't work if i put something in the brackets – anne Feb 14 at 12:56
  • 2
    Worksheet_Change is triggered by an event, there is no way to call it from a macro. You can create a macro which is called by your button, and you can also call the same macro from your Worksheet_Change Sub. – Máté Juhász Feb 14 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.