And if that increment were nice, you could even use some arithmetic:
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Me.Range("d:o")) Is Nothing Then Exit Sub
If Target.Row < 9 Then Exit Sub
If Target.Row Mod 4 <> 1 Then Exit Sub
Application.ScreenUpdating = False
frmChange.Show
Application.ScreenUpdating = True
End Sub
This got row 9, 13, 17, 21, ...
(I didn't see a pattern with your sample.)
Prometheus wrote:
>
> Excellent, thanks for the tip. I thought it would be nice to clear the
> cell for the user but didn't realize that was causing the
> recalculation. One other question I have is if it's possible to
> declare more than one range in the code
>
> Code:
> --------------------
>
> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
>
> Const WS_RANGE As String = "D9:O9"
> On Error Resume Next
> If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
> Application.ScreenUpdating = False
> frmChange.Show
> End If
>
> End Sub
>
> --------------------
>
> For example, is there a way to set the range as D9:09, D13:013,
> D15:015, etc, without creating a new sub for each?
>
> --
> Prometheus
> ------------------------------------------------------------------------
> Prometheus's Profile: http://www.excelforum.com/member.php...o&userid=15697
> View this thread: http://www.excelforum.com/showthread...hreadid=470342
--
Dave Peterson
Bookmarks