Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi,
I am writing the following piece of code to change a cell color when its content is changed: ************************************************** ***** Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Me.Range("$E$25")) Is Nothing Then If ThisWorkbook.Worksheets(6).Cells(25, 5) 0 Then ThisWorkbook.Worksheets(6).Cells(25, 5).Interior.Pattern = xlGray16 End If End Sub ************************************************** ***** However, my excel window crashes and i get the following message "Microsoft Excel has encoutered a problem and needs to close..." Can anyone tell me why this should happen? Appreciate an urgent response. Thanks and regards, Ashish |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi,
Your sub is missing an End If but that wouldn't cause Excel to crash. I would try restarting your PC. Mike "Ashish" wrote: Hi, I am writing the following piece of code to change a cell color when its content is changed: ************************************************** ***** Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Me.Range("$E$25")) Is Nothing Then If ThisWorkbook.Worksheets(6).Cells(25, 5) 0 Then ThisWorkbook.Worksheets(6).Cells(25, 5).Interior.Pattern = xlGray16 End If End Sub ************************************************** ***** However, my excel window crashes and i get the following message "Microsoft Excel has encoutered a problem and needs to close..." Can anyone tell me why this should happen? Appreciate an urgent response. Thanks and regards, Ashish |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi,
The sub is as follows: ************************************************** ***** Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Me.Range("$E$25")) Is Nothing Then ThisWorkbook.Worksheets(6).Cells(25, 5).Interior.Pattern = xlGray16 End If End Sub ************************************************** ***** Please let me know why should EXCEL crash when i invoke this SUBROUTINE (MACRO). BTW, restarting the PC does not seem to help. Thanks and regards, Ashish "Mike H" wrote: Hi, Your sub is missing an End If but that wouldn't cause Excel to crash. I would try restarting your PC. Mike "Ashish" wrote: Hi, I am writing the following piece of code to change a cell color when its content is changed: ************************************************** ***** Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Me.Range("$E$25")) Is Nothing Then If ThisWorkbook.Worksheets(6).Cells(25, 5) 0 Then ThisWorkbook.Worksheets(6).Cells(25, 5).Interior.Pattern = xlGray16 End If End Sub ************************************************** ***** However, my excel window crashes and i get the following message "Microsoft Excel has encoutered a problem and needs to close..." Can anyone tell me why this should happen? Appreciate an urgent response. Thanks and regards, Ashish |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I'd try changing printers (or printer drivers).
Lots of crashes in excel turn out to be caused by printer drivers. And since you're playing with a color (something displayed on the screen), excel uses the printer driver to determine how it should look on the screen and when printed (WYSIWYG stuff). Ashish wrote: Hi, I am writing the following piece of code to change a cell color when its content is changed: ************************************************** ***** Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Me.Range("$E$25")) Is Nothing Then If ThisWorkbook.Worksheets(6).Cells(25, 5) 0 Then ThisWorkbook.Worksheets(6).Cells(25, 5).Interior.Pattern = xlGray16 End If End Sub ************************************************** ***** However, my excel window crashes and i get the following message "Microsoft Excel has encoutered a problem and needs to close..." Can anyone tell me why this should happen? Appreciate an urgent response. Thanks and regards, Ashish -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional formatting causing Excel to crash | Excel Discussion (Misc queries) | |||
cell change event | Excel Worksheet Functions | |||
cell value change event | Excel Worksheet Functions | |||
Macro Glitch Causing Crash | Excel Discussion (Misc queries) | |||
Charts causing program to crash | Charts and Charting in Excel |