LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Code looping until machine freezes!!?


Hi all,

I have tried to devise some code so that if a cell in a set rang
contains a value or character of any kind to change to a colour, i
works but seems to loop many times until my machine freezes (i ca
press escape to get out of it!) any ideas why and perhaps a nudge i
the right direction please!
Thanks,

Simon.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim mycell
Dim rng As Range

Set rng = Range("V2:V40")
For Each mycell In rng
If mycell < "" Then
mycell.Select
With Selection.Interior
.ColorIndex = 44
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End If
Next
End Su

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=47607

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel xls files open as Machine Code ocar23 New Users to Excel 0 May 22nd 08 12:46 AM
Reference & update destin. cells on 1st machine from source workbook on 2nd machine. [email protected] Excel Discussion (Misc queries) 6 February 28th 06 05:15 AM
Macro code error; machine dependent SJC Excel Worksheet Functions 4 February 1st 06 04:31 PM
Line of code hanging up on one machine??? Don G - ExcelForums.com Excel Programming 3 May 21st 05 11:02 PM
code is not working on another machine Papa Jonah Excel Programming 4 March 1st 05 07:57 PM


All times are GMT +1. The time now is 06:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"