Private Sub Worksheet_Change(ByVal Target As Range)

PanzerAttack

Board Regular
Joined
Jan 3, 2008
Messages
197
I've a sheet names Customer where I'm using this function

Private Sub Worksheet_Change(ByVal Target As Range)

So that when I change a cell a macro runs.

I've copied this sheet and renamed it business so I don't have to start from scratch but now it keeps jumping to the customer sheet when I make the change in the Business tab.

Does anyone know why?
 

Some videos you may like

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Steeviee

Active Member
Joined
Sep 9, 2009
Messages
380
You probably have the code in the wrong worksheet???

Press Alt F11. The code needs to be in the new worksheet code (double click on 'Business' in the Project Explorer window - and remove it from wherever it is now!
 

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
You'll need to post the code. ;)

Most likely you have an explicit reference to the Customer sheet.
 

PanzerAttack

Board Regular
Joined
Jan 3, 2008
Messages
197
Weirdly I've managed to fix it, I simply saved it to it's own sheet and then copied it back and it was okay.

Thanks for looking though
 

Watch MrExcel Video

Forum statistics

Threads
1,127,505
Messages
5,625,199
Members
416,080
Latest member
blemon

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
Top