Hallo zusammen. Ich wende diesen Code in einer neutralen Datei / Tabelle an, er funktioniert auch. Nun möchte ich ihn in einer Tabelle anwenden wo mit Formeln auf ein anderes Tabelleblatt zurück gegriffen wird. Dann fuktioniert dieser Code nicht mehr. Gibt es eine möglichkeit im Code was die Tabellenverbindung ignorieren würde? Weis da jemand einen Rat? Gruß Josef
Visual Basic:
Option Explicit
' Pause for a given number of seconds
Sub Pause(delaySecs As Single)
Dim startTime As Single
startTime = Timer
Do While Timer < startTime + delaySecs
DoEvents
Loop
End Sub
' Blink a cell a specified number of times and interval, then leave it colored
Sub BlinkCell(rng As Range, blinkCount As Integer, intervalSecs As Single)
Dim i As Integer
For i = 1 To blinkCount
rng.Interior.Color = Range("B19").Interior.Color ' Color from B19
Pause intervalSecs
rng.Interior.ColorIndex = xlColorIndexNone ' Clear fill
Pause intervalSecs
Next i
' Leave final color
rng.Interior.Color = Range("B19").Interior.Color
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Address = "$C$15" Then
Cancel = True
On Error GoTo CleanUp
Application.EnableEvents = False
' Springe zu D15
Application.Goto Reference:=Range("D15"), Scroll:=True
' Blinke und färbe D15
BlinkCell Range("D15"), CInt(Range("B17").Value), CSng(Range("B18").Value)
CleanUp:
Application.EnableEvents = True
End If
End Sub