one code to do multiple things

M

Morgan

hi, i have the code below which takes the value in cell U17 everytime it
changes, and places it in column A on a sheet called graphs thereby forming a
list down the sheet of all the values that appear in cell U17, for charting
purposes.

What i would like to do is to be able to duplicate this for different cells.
ie have the cell values of W25 appear in a list in column K on the graphs
sheet, and so on. this code was written for me by someone else as, could you
please give me some code that will enable me to capture the values for two or
three cells in sheet1 into the sheet called graphs?

any help would be greatly appreciated, thank you.

Private Sub Worksheet_Calculate()
Dim Dest As Range
With Sheets("graphs")
Set Dest = .Range("A" & Rows.Count).End(xlUp)
If Range("U17") <> Dest Then _
Dest.Offset(1) = Range("U17")
End With
End Sub
 
S

Simon Lloyd

Hi try this, it works on the activecell, if it has a formula then th
value is transferred


VBA Code:
--------------------


Private Sub Worksheet_Calculate(
Dim Dest As Rang
With Sheets("graphs"
Set Dest = .Range("A" & Rows.Count).End(xlUp
If ActiveCell.HasFormula And ActiveCell <> Dest Then
Dest.Offset(1) = ActiveCel
End Wit
End Sub
--------------------







hi, i have the code below which takes the value in cell U17 everytim
i
changes, and places it in column A on a sheet called graphs thereb
forming
list down the sheet of all the values that appear in cell U17, fo
chartin
purposes

What i would like to do is to be able to duplicate this for differen
cells
ie have the cell values of W25 appear in a list in column K on th
graph
sheet, and so on. this code was written for me by someone else as
could yo
please give me some code that will enable me to capture the values fo
two o
three cells in sheet1 into the sheet called graphs

any help would be greatly appreciated, thank you

Private Sub Worksheet_Calculate(
Dim Dest As Rang
With Sheets("graphs"
Set Dest = .Range("A" & Rows.Count).End(xlUp
If Range("U17") <> Dest Then
Dest.Offset(1) = Range("U17"
End Wit
End Su

-
thanks


--
Simon Lloyd

Regards
Simon Lloy
'Microsoft Office Help' (http://www.thecodecage.com)
 
M

Morgan

hi i tried it but i couldn't get it to work
--
thanks


Simon Lloyd said:
Hi try this, it works on the activecell, if it has a formula then the
value is transferred.
VBA Code:
Private Sub Worksheet_Calculate()
Dim Dest As Range
With Sheets("graphs")
Set Dest = .Range("A" & Rows.Count).End(xlUp)
If ActiveCell.HasFormula And ActiveCell <> Dest Then _
Dest.Offset(1) = ActiveCell
End With
End Sub hi, i have the code below which takes the value in cell U17 everytime
it
changes, and places it in column A on a sheet called graphs thereby
forming a
list down the sheet of all the values that appear in cell U17, for
charting
purposes.

What i would like to do is to be able to duplicate this for different
cells.
ie have the cell values of W25 appear in a list in column K on the
graphs
sheet, and so on. this code was written for me by someone else as,
could you
please give me some code that will enable me to capture the values for
two or
three cells in sheet1 into the sheet called graphs?

any help would be greatly appreciated, thank you.

Private Sub Worksheet_Calculate()
Dim Dest As Range
With Sheets("graphs")
Set Dest = .Range("A" & Rows.Count).End(xlUp)
If Range("U17") <> Dest Then _
Dest.Offset(1) = Range("U17")
End With
End Sub

--
thanks


--
Simon Lloyd

Regards,
Simon Lloyd
'Microsoft Office Help' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: 1
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=182101

Microsoft Office Help

.
 
D

Don Guillett

If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
Morgan said:
hi i tried it but i couldn't get it to work
--
thanks


Simon Lloyd said:
Hi try this, it works on the activecell, if it has a formula then the
value is transferred.
VBA Code:
Private Sub Worksheet_Calculate()
Dim Dest As Range
With Sheets("graphs")
Set Dest = .Range("A" & Rows.Count).End(xlUp)
If ActiveCell.HasFormula And ActiveCell <> Dest Then _
Dest.Offset(1) = ActiveCell
End With
End Sub hi, i have the code below which takes the value in cell U17 everytime
it
changes, and places it in column A on a sheet called graphs thereby
forming a
list down the sheet of all the values that appear in cell U17, for
charting
purposes.

What i would like to do is to be able to duplicate this for different
cells.
ie have the cell values of W25 appear in a list in column K on the
graphs
sheet, and so on. this code was written for me by someone else as,
could you
please give me some code that will enable me to capture the values for
two or
three cells in sheet1 into the sheet called graphs?

any help would be greatly appreciated, thank you.

Private Sub Worksheet_Calculate()
Dim Dest As Range
With Sheets("graphs")
Set Dest = .Range("A" & Rows.Count).End(xlUp)
If Range("U17") <> Dest Then _
Dest.Offset(1) = Range("U17")
End With
End Sub

--
thanks


--
Simon Lloyd

Regards,
Simon Lloyd
'Microsoft Office Help' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: 1
View this thread:
http://www.thecodecage.com/forumz/showthread.php?t=182101

Microsoft Office Help

.
 
J

JLatham

Morgan,
You have asked this question at least 4 different times over the past few
days and have received several responses. Apparently none has provided a
solution?

It would help us all to help you if you can stick to a single discussion
thread so that we can see all that has been tried and find out why the
offered solutions have failed.

My first question THIS time, is why are you still trying to use the
_Calculate() event rather than the _Change() event?

Morgan said:
hi i tried it but i couldn't get it to work
--
thanks


Simon Lloyd said:
Hi try this, it works on the activecell, if it has a formula then the
value is transferred.
VBA Code:
Private Sub Worksheet_Calculate()
Dim Dest As Range
With Sheets("graphs")
Set Dest = .Range("A" & Rows.Count).End(xlUp)
If ActiveCell.HasFormula And ActiveCell <> Dest Then _
Dest.Offset(1) = ActiveCell
End With
End Sub hi, i have the code below which takes the value in cell U17 everytime
it
changes, and places it in column A on a sheet called graphs thereby
forming a
list down the sheet of all the values that appear in cell U17, for
charting
purposes.

What i would like to do is to be able to duplicate this for different
cells.
ie have the cell values of W25 appear in a list in column K on the
graphs
sheet, and so on. this code was written for me by someone else as,
could you
please give me some code that will enable me to capture the values for
two or
three cells in sheet1 into the sheet called graphs?

any help would be greatly appreciated, thank you.

Private Sub Worksheet_Calculate()
Dim Dest As Range
With Sheets("graphs")
Set Dest = .Range("A" & Rows.Count).End(xlUp)
If Range("U17") <> Dest Then _
Dest.Offset(1) = Range("U17")
End With
End Sub

--
thanks


--
Simon Lloyd

Regards,
Simon Lloyd
'Microsoft Office Help' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: 1
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=182101

Microsoft Office Help

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top