ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Offset Range (https://www.excelbanter.com/excel-programming/414364-offset-range.html)

Enigo

Offset Range
 
Hi,

I am using the following code but I need to have D3 value change depending
on what row I am entering data into.

I have been working on this and can't find the answer.

Here's the code:

Private Sub Worksheet_Change(ByVal Target As Range)

Dim AOI As Range

Set AOI = [D3]

If Not Intersect(Target, AOI) Is Nothing Then
Select Case AOI.Text
Case Is = "Possible Soft Hold"
AOI.Offset(0, 7).Value = Date
Case Is = "Soft Hold"
AOI.Offset(0, 8).Value = Date
Case Is = "Hard Cut"
AOI.Offset(0, 9).Value = Date
End Select

End If
End Sub

Bob Phillips

Offset Range
 
Private Sub Worksheet_Change(ByVal Target As Range)
Dim AOI As Range

If Not Intersect(Target, Me.Columns(4)) Is Nothing Then

With Target

Select Case AOI.Text
Case Is = "Possible Soft Hold"
AOI.Offset(0, 7).Value = Date
Case Is = "Soft Hold"
AOI.Offset(0, 8).Value = Date
Case Is = "Hard Cut"
AOI.Offset(0, 9).Value = Date
End Select
End With
End If
End Sub

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Enigo" wrote in message
...
Hi,

I am using the following code but I need to have D3 value change depending
on what row I am entering data into.

I have been working on this and can't find the answer.

Here's the code:

Private Sub Worksheet_Change(ByVal Target As Range)

Dim AOI As Range

Set AOI = [D3]

If Not Intersect(Target, AOI) Is Nothing Then
Select Case AOI.Text
Case Is = "Possible Soft Hold"
AOI.Offset(0, 7).Value = Date
Case Is = "Soft Hold"
AOI.Offset(0, 8).Value = Date
Case Is = "Hard Cut"
AOI.Offset(0, 9).Value = Date
End Select

End If
End Sub





All times are GMT +1. The time now is 09:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com