When BA2 is mergedBA2:BF6 the code works fine if macro is attached to a button but does not work on the view code. Any suggestions?
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$BA$2" Then
Dim pausetime As Single
Dim start As Single
Dim finish As Single
Dim totaltime As Single
pausetime = 25 ' Set duration.
start = Timer ' Set start time.
Sheets(1).Range("BA2").Value = 25
Do While Timer < start + pausetime
DoEvents ' Yield to other processes.
Sheets(1).Range("BA2").Value = _
Format(pausetime + (start - Timer), "##")
Loop
Sheets(1).Range("BA2").Value = 25
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$BA$2" Then
Dim pausetime As Single
Dim start As Single
Dim finish As Single
Dim totaltime As Single
pausetime = 25 ' Set duration.
start = Timer ' Set start time.
Sheets(1).Range("BA2").Value = 25
Do While Timer < start + pausetime
DoEvents ' Yield to other processes.
Sheets(1).Range("BA2").Value = _
Format(pausetime + (start - Timer), "##")
Loop
Sheets(1).Range("BA2").Value = 25
End If
End Sub