Thread
:
Using worksheet_change to change value of target cell??
View Single Post
#
3
Posted to microsoft.public.excel.programming
[email protected]
external usenet poster
Posts: 9
Using worksheet_change to change value of target cell??
I also get a type mismatch error if I select multiple cells within the
renge and edit them(i.e. clear the cells).
wrote:
Alright, I got this to work with this code:
If Intersect(Range("b17:k40"), Target) Then
If Target < 1 Then
'x = Target
y = Range("h12").Value
x = Target + y
Range(Target.Address).Value = x
Else
Exit Sub
End If
End If
but if I change a cell outside that range I get an error (Run-time
error '91')
Am I missing something with that intersect command?
Thanks,
Mark
wrote:
Is it possible to change the data within a cell based on what is
entered?
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Range("C16:F39"), Target) Then
x = Target
Range(Target.Address) = x + Range(F11)
End If
End Sub
I tried using this but got a Run Time '1004' error.
Basically, the user is inputing a number and I want to add a constant
from another cell to this number for the output. I know I can do this
with two tables or two sheets but I was hoping I could have it
automatically update the same cell.
Thanks,
Mark
Reply With Quote
[email protected]
View Public Profile
Find all posts by
[email protected]