ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   worksheet change doesn't always work (https://www.excelbanter.com/excel-discussion-misc-queries/91001-worksheet-change-doesnt-always-work.html)

damorrison

worksheet change doesn't always work
 
I have noticed that the worksheet change doesn't always work,
expecially when I have been working on excel for a while and have
opened and closed a lot of workbooks,or if I have used VBA help alot...
if I reboot the computer and open a workbook that has a worksheet
change event it works fine, is there a way around this besides
rebooting the computer,
Here's the code I am using for one of the sheets: but I am sure it is
not the code because I have noticed this behaviour in othe workbooks...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$5" Then
Range("G5").Select
ActiveCell.FormulaR1C1 = "=ROUNDUP(RC[-1]/8.0625,0)"
Range("C5").Select
Application.SendKeys "%{down}"
End If
If Target.Address = "$C$5" Then
Range("D5").Select
Application.SendKeys "%{down}"
End If
If Target.Address = "$D$5" Then
Range("B10").Select
Application.SendKeys "%{down}"
End If

If Union(Range("$b10:$b12"), Target).Address =
Range("$b10:$b12").Address Then
UserForm2.Show False
myRow = Target.Row
End If


End Sub


mrice

worksheet change doesn't always work
 

It would be worth checking the status of Application.EnableEvents. If
this has been set to false by some process, the events aren't detected.


--
mrice

Research Scientist with many years of spreadsheet development experience
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=546288



All times are GMT +1. The time now is 07:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com