![]() |
|
#2
|
|||
|
|||
|
Hi,
The reason you go into a continuous look is that each time a chane is made it will fire the macro. I think you need "Application.EnableEvents = False" as indicated in the code. However, I'm not completely sure if the placement is correct. Also please use "Code" tags when you post a code. Code:
"Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Target.Interior.ColorIndex = 3
Range("V1") = 0
Range("V1").Interior.ColorIndex = 0
For arow = 1 To 50
Application.EnableEvents = False
For acol = 1 To 20
If Cells(arow, acol).Interior.ColorIndex = 3 Then
Range("V1").Value = Range("V1").Value + 1
End If
Next acol
Next arow
Application.EnableEvents = True
End Sub
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Macro to convert text to endnote?
|
Orifacious | Word VBA | 27 | 03-29-2022 02:58 PM |
Macro to convert word file into pdf
|
cc9083 | Word VBA | 2 | 02-23-2015 01:22 AM |
| custom icon, undo/redo for macro, permanent macro | Rapier | Excel | 0 | 08-05-2013 06:30 AM |
Need a macro to convert all graphics to GIF format
|
sleake | Word VBA | 3 | 02-10-2012 05:00 PM |
Creating macro to convert/print to pdf
|
shabbaranks | Word | 3 | 05-18-2011 08:59 AM |