-
worksheet change function
Hi All,
I want to use the worksheet change function but need help.
I have a spreadsheet where if someone types in cell A3, A4, A5 etc, I want to add a formula in to Y3, Y4, Y5 etc. In otherwords, each time someone enters in column A, a formula is entered in column Y for the corresponding row.
Is this possible?
-
[vba]
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A:A"
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
.Offset(0,24).Formula = your_formula here
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub
[/vba]
'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.
Last edited by Bob Phillips; 10-10-2006 at 10:02 AM.
-
thank you, seems to work a treat
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules