Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

detect changing cells

Status
Not open for further replies.

leroiv

Programmer
Mar 29, 2007
8
RO
Hi everyone!
A have a worksheet with the following data:

AZ5=4 , BA5=3, BB5=2, BC5=1

in column AP , I have a function in specific cells who copies the values from above cells:

AP42=3, AP47=3, AP52=2, AP57=1, AP60=1 and so on.. (about 100 cells copies data from cells above)
What I want: when I change values in AZ5,BA5,BB5,BC5 the cells from column AP (AP42,AP47,AP52,AP57,AP60... with the function "copiereNrTura" in it) to copy values, and changed cell (AP42,AP47,AP52,AP57,AP60..) to trigger another procedure who will write something in another cells (A42:AI42,A47:AI47,A52:AI52,A57:AI57,A60:AI60..). How I will do that??
Many thanks for your replies!

What I have:

(this is the function who copies values form AZ5,BA5,BB5,BC5)
Code:
Function copiereNrTura(adresaTura As Range)
copiereNrTura = adresaTura.Value
End Function
How I will trigger the canged cell to run the procedute to write in (A17:AI17, A42:AI42,...)?
 
The formula =CELL("address") will return the the address of the last changed cell.

So for example, you could do:

=IF(CELL("address")="$AZ$5",copiereNrTura(AZ5),whatever)

 




leroiv,

Just a clarification FYI...
[quoteleroiv]I have a function in specific cells who copies the values from above cells:[/quote]

Spreadsheet functions cannot copy anything. The COPY method is followed by the PASTE method, which is not happening, because that includes values and formats.

Spreadsheet functions return values only.

It sounds like nit picking, but terms mean something, and in Excel the term COPY has connotations that are not associated with spreadsheet functions.

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
You are right Skip , my function return a value in a cell from another ...

Another thing I want to clarify:
In a cell I have a "data validation list" (R11) . When I select an item from the drop-down list of DV (data validation) I want to trigger a subrutine to write a value in another cell (X11) but it isn't work. Only thing that is working is the message box that appears but the range X11 remains empty.

Code:
Private Sub Worksheet_Change(ByVal target As Range)
Select Case target.Address(False, False)
     Case "W11"
             Range("Y11").Value = 8
     Case "R11"
             MsgBox "It's not working!"
             Range("X11").Value = 4
             [i]'Intersect(target.EntireRow, Cells(11, "X")).Value = 4[/i]
             [i]'target.Offset(0, 6)=4[/i]
End Select
End Sub

The italic lines are commented and are another option I have tried but still not working. I'm using Excel 2002
 



Put a break in your code and step thru. Observe what happens.

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top