Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have a this code. the problem is when the "Card Entered" part is also a value change...so it just keeps repeating. is there a way to make it so if value = "Card Entered" the code does not run Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = Range("fa7").Address Then Range("fc7").Value = Range("fa7").Value Range("fa7") = "Card Entered" End If End Sub ThaNKS in advance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False On Error Goot ws_exit: If Target.Address = Range("fa7").Address Then Range("fc7").Value = Range("fa7").Value Range("fa7") = "Card Entered" End If ws_exit: Application.EnableEvents = True End Sub -- HTH Bob Phillips "choice" wrote in message ... I have a this code. the problem is when the "Card Entered" part is also a value change...so it just keeps repeating. is there a way to make it so if value = "Card Entered" the code does not run Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = Range("fa7").Address Then Range("fc7").Value = Range("fa7").Value Range("fa7") = "Card Entered" End If End Sub ThaNKS in advance |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Any thime you are using the on change event you have to be careful about
having the procedure call itself recursivly. This occures if you change a value within the procedure which causes the procedure to fire again. To avoid this you need to add application.enableevents = false at the beginning of the code and application.enableevents = true at the end of the code... Be careful to always turn the events back on again... HTH "choice" wrote: I have a this code. the problem is when the "Card Entered" part is also a value change...so it just keeps repeating. is there a way to make it so if value = "Card Entered" the code does not run Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = Range("fa7").Address Then Range("fc7").Value = Range("fa7").Value Range("fa7") = "Card Entered" End If End Sub ThaNKS in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
change scaling % but font size didnt change porportionally, pls he | Excel Discussion (Misc queries) | |||
Excel bar chart formatting of bars to change colors as data change | Excel Discussion (Misc queries) | |||
Use date modified to change format & create filter to track change | Excel Worksheet Functions | |||
Change workbook sheet reference using cell A1 to change a vairable | Excel Worksheet Functions | |||
Change Cell from Validated List Not Firing Worksheet Change Event | Excel Programming |