ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Highlighting row causing problems with other progarms. (https://www.excelbanter.com/excel-programming/361207-highlighting-row-causing-problems-other-progarms.html)

chuckm

Highlighting row causing problems with other progarms.
 
Hi,
I use a sheet macro to highlight an entire row when certain cells are
clicked....works great.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Column < 3 Then
Rows(Target.Row).Select
End If

End Sub


The problem comes when I run other programs that go to this particular
sheet to do formatting......e.g. select particular ranges and then
change colors and add or remove borders. It seems that as ranges are
selected the above sheet macro is executed. this screws everything
up.

Is there some way for the other macros (these are not sheet specific)
to de-activate or ignore this sheet macro so that they will execute
properly. (they run fine without the sheet macro present.
Thanks
chuckm


Ivan Raiminius

Highlighting row causing problems with other progarms.
 
Hi Chuck,

see help for application.enableevents property. (The other macros
should disable events while they are changing worksheet and enable them
again immediately when finished.)

Regards,
Ivan


chuckm

Highlighting row causing problems with other progarms.
 
Ivan...thanks.... that did the trick
chuck



All times are GMT +1. The time now is 01:37 PM.

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