Hi Anyone!
I'm Using the following code in my workbook's sheet. I use this code to double click and change the values to what I want and also to change my serial number in H8 and H9 according to the date.
But when I use the code the screen flickers. I'm Using Excel 2007.
I have tried many ways to get rid of this. But everything has failed.
Can anybody find me an alternative to stop the flickering.Code:Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) On Error Resume Next Application.ScreenUpdating = False If Not Intersect(Target, Range("G4:G14")) Is Nothing Then ' You can Change the range here Cancel = True With Target .Font.Name = "Wingdings" .Font.Size = 20 .HorizontalAlignment = xlCenter End With If Target.Value = "þ" Then Target.Value = "ý" Else Target.Value = "þ" End If End If If Not Intersect(Target, Range("J7:J7")) Is Nothing Then Cancel = True If Target.Value = "OUT" Then Target.Value = "IN" Else Target.Value = "OUT" End If End If If Not Intersect(Target, Range("F8:F8")) Is Nothing Then Cancel = True If Target.Value = "INSURED" Then Target.Value = "NOT INSURED" Else Target.Value = "INSURED" End If End If If Not Intersect(Target, Range("D7:D7")) Is Nothing Then Cancel = True If Target.Value = "Cash" Then Target.Value = "Credit" Else Target.Value = "Cash" End If End If If Not Intersect(Target, Range("J8:J8")) Is Nothing Then Cancel = True If Target.Value = "Foreigner" Then Target.Value = "Local" Else Target.Value = "Foreigner" End If End If Application.ScreenUpdating = True End Sub Private Sub Worksheet_Change(ByVal Target As Range) Dim oCell As Range If Not Intersect(Target, Range("H8:H9")) Is Nothing Then Application.EnableEvents = False For Each oCell In Intersect(Target, Range("H8:H9")) If IsNumeric(oCell) And Not oCell = "" Then oCell = Format(oCell, "0000") & " / " & Format(Now(), "yy") End If Next oCell Application.EnableEvents = True End If End Sub
Regards
Fiza
you havent gotin the second subCode:Application.ScreenUpdating = True/false
Code:Private Sub Worksheet_Change(ByVal Target As Range)
Mojito connoisseur and a dabbler in Cisco
where does code go ?
look here
how to insert code
how to enter array formula
why use -- in sumproduct
recommended reading
wiki Mojito
how to say no convincingly
most important thing you need
Martin Wilson: SPV
and RSMBC
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks