Worksheet change event not working

Heyjoe

New member
Joined
Jan 3, 2019
Messages
59
Reaction score
0
Points
0
Location
USA
Excel Version(s)
2019
Hello

This macro works. Nxword is a command button and the macro makes it invisible.
Code:
Public Sub makeinvisible()
If Range("TypeDrill") = "Sentences" Then Sheets("Word Drills").Nxword.Visible = False
End Sub

However, in the following change event the call statement does not work.

Code:
Private Sub Worksheet Change(ByVal Target As Range)
Call makeinvisible
End Sub

I cannot find anything wrong with the Worksheet change event.

Thanks for any help.
 
Wonder where these codes are located in the workbook and what the actual code really is.
VBA doesn't accept the second one like that.

Can you attach a small sample workbook so we know what you're working with ?
 
Well I designed another workbook and copied the macros into it. In this new workbook the change event does work. So I will look at the first workbook again. Thank you.
 
OK I got it working in the first workbook. I had spelled the name of the command button wrong in the change event.
 
Back
Top