VBA help with Event change

decadence

Well-known Member
Joined
Oct 9, 2015
Messages
525
Office Version
  1. 365
  2. 2016
  3. 2013
  4. 2010
  5. 2007
Platform
  1. Windows
Hi, I have been looking at a lot of event change codes but none seem to work... i would like the event change to fire if rows or columns are deleted and if they have been deleted then set the new Range as ActiveSheet.UsedRange to get the true range of cells.
I have tried enabling and disabling Enable Events and I have used worksheet change and worksheet selection change while testing the codes but still nothing seems to work, Can someone help please
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
A Worksheet_Change event is triggered if you delete a row or column - assuming you haven't disabled events.
 
Upvote 0
Hi RoryA, I have Enable Events set to true on Workbook Open so not sure what is going wrong and have been using Worksheet_Change(ByVal Target As Range)
 
Last edited:
Upvote 0
I have Enable Events set to true on Workbook Open

That won't achieve much. If events are disabled, the Workbook_Open won't run, and if events are enabled, there's no point in re-enabling them. ;) You'd need to use Auto_Open in a normal module for that approach to have any effect (it would be too late for your Open event code though).
 
Last edited:
Upvote 0
Thanks for the info RoryA, I will try and see what the problem is
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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