Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Worksheet_change Target Address is Reference Cell | Excel Programming | |||
Worksheet_change Target Address is Reference Cell | Excel Programming | |||
Worksheet_change Target Address is Reference Cell | Excel Programming | |||
How find if target is object in Worksheet_Change (ByVal Target As.. ?) | Excel Programming | |||
Error with Target.Name.Name in Worksheet_Change event | Excel Programming |