I have a code that, when a cell is selected it calls a module to run that code. I'm using the Select Case code to accomplish this. It's working great, but the problem is, sometimes I have to insert or delete rows on the page, which changes the cell reference of the cell I want to select. Is there a code that will keep the cell reference regardless of where the cell moves to (ie. relative reference)? In the example below, if I click B198, it runs the module for "FillOrder" just fine. But if I have to delete a row before it, then that cell moves to B197. How can I get this code to continue to reference that new location? Or is there another way to do this?
Example
Example
VBA Code:
'Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Resp As Long
Dim g As String
If Not Intersect(ActiveCell, Range("B9", "B459")) Is Nothing Then
Select Case ActiveCell.Address(0, 0)
Case "B198"
FillOrder
End Select
End If