View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Doug Glancy Doug Glancy is offline
external usenet poster
 
Posts: 770
Default Change Event that Loops

Monkey,

Looks like you've put yourself back into a loop. Clearing contents would be
a change, I think. So, either put the clearcontents inside your if
statement, or set enableevents to false.

hth,

Doug Glancy

"ExcelMonkey " wrote in message
...
Another question. I have put a line just under the variable
declarations which seems to stall the code:

Range("DynamicNameRange").ClearContents

I can't figure out why this does not work. When I use this line of
code by itself in a stand-alone module it works fine.




Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Export As Integer
Dim VRange As Range

Range("DynamicNameRange").ClearContents

Export = Range("DropDownExport")

Set VRange = Range("DropDownExport")
If Union(Target, VRange).Address = VRange.Address Then

Select Case Export

Case Is = 1
Range("FuelTypeName").Copy Destination:=Range("NamePaste")


End Select

End If


End Sub


---
Message posted from http://www.ExcelForum.com/