Private Sub Worksheet_Change(ByVal Target As Range) is not visible in the macro list

Rasto800

New Member
Joined
Apr 8, 2023
Messages
3
Office Version
  1. 2021
Platform
  1. Windows
Hi, if I save this type of code in a module in the workbook, it doesn't show up in the macro list at all, so I can't run it. The standard macro "sub macro1()" works fine. Where could be the problem? I tried save it in "personal.xlsb" as well, without success.

It doesn't matter what the code is supposed to do, it doesn't even appear that way:

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

End Sub


Thank you very much for your advice.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi,

These Event macros are stored in the respective Sheet Module ...
A shortcut to jump directly to the Sheet Module :
Point your cursor on the Tab name ... right-click to open sub-menu ... and select the 5th choice : View Code
 
Upvote 0
Hi,

I know how to get there, I know where to enter the code, but there is no way to run it - when I press F5 there is nothing in the list of macros even though the code is saved and should be visible.
 
Upvote 0
You do not "run" event code. It is triggered automatically & in your case that is when a cell on the relevant sheet is changed.
 
Upvote 0
Solution
My mistake, I only had the code header there, thinking it was supposed to appear in the macro list.

OK, it works, thank you for your kindness.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,198
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top