#1   Report Post  
Paul Hyett
 
Posts: n/a
Default How do I...

Hi,

I wonder if you could help?

How do I go about taking data from a succession of cells in one
spreadsheet, inserting them one at a time into a formula in another
spreadsheet, and then putting the result of each calculation back into
the original spreadsheet in cells I specify?

Regards,
--
Paul Hyett, Cheltenham
  #2   Report Post  
Norman Jones
 
Posts: n/a
Default

Hi Paul,

Perhaps you could adopt an approach like this:

'======================
Public Sub TestIt()

Dim RngInput As Range
Dim RngOutput As Range
Dim i As Long
Dim v As Double

Set RngInput = Sheets("Sheet3").Range("A1:A10")
Set RngOutput = Sheets("Sheet3").Range("C1:C10")

For i = 1 To RngInput.Cells.Count
If IsNumeric(RngInput(i)) Then
v = RngInput(i).Value
RngOutput(i) = v * (Application.Pi ^ 2)
End If
Next i

End Sub
'<<======================

---
Regards,
Norman



"Paul Hyett" wrote in message
...
Hi,

I wonder if you could help?

How do I go about taking data from a succession of cells in one
spreadsheet, inserting them one at a time into a formula in another
spreadsheet, and then putting the result of each calculation back into
the original spreadsheet in cells I specify?

Regards,
--
Paul Hyett, Cheltenham



  #3   Report Post  
Paul Hyett
 
Posts: n/a
Default

In microsoft.public.excel.misc on Sat, 6 Aug 2005 at 11:29:51, Norman
Jones wrote :
Hi Paul,

Perhaps you could adopt an approach like this:

'======================
Public Sub TestIt()

Dim RngInput As Range
Dim RngOutput As Range
Dim i As Long
Dim v As Double

Set RngInput = Sheets("Sheet3").Range("A1:A10")
Set RngOutput = Sheets("Sheet3").Range("C1:C10")

For i = 1 To RngInput.Cells.Count
If IsNumeric(RngInput(i)) Then
v = RngInput(i).Value
RngOutput(i) = v * (Application.Pi ^ 2)
End If
Next i

End Sub
'<<======================

Thanks for this, but I don't follow some of it - are 'Long' and 'Double'
worksheet functions?

I'm using Excel 2002 and I don't recognise them.
--
Paul Hyett, Cheltenham
  #4   Report Post  
Norman Jones
 
Posts: n/a
Default

Hi Paul,

My suggestion was to use a VBA procedure to acieve your objective.

Thanks for this, but I don't follow some of it - are 'Long' and 'Double'
worksheet functions?


Long and Double are data types that are declared for two of the procedure's
variables.

If You are not familiar with macros (aka procedures), you may wish to visit
David McRitchie's 'Getting Started With Macros And User Defined Functions'
at:

http://www.mvps.org/dmcritchie/excel/getstarted.htm


---
Regards,
Norman



"Paul Hyett" wrote in message
...
In microsoft.public.excel.misc on Sat, 6 Aug 2005 at 11:29:51, Norman
Jones wrote :
Hi Paul,

Perhaps you could adopt an approach like this:

'======================
Public Sub TestIt()

Dim RngInput As Range
Dim RngOutput As Range
Dim i As Long
Dim v As Double

Set RngInput = Sheets("Sheet3").Range("A1:A10")
Set RngOutput = Sheets("Sheet3").Range("C1:C10")

For i = 1 To RngInput.Cells.Count
If IsNumeric(RngInput(i)) Then
v = RngInput(i).Value
RngOutput(i) = v * (Application.Pi ^ 2)
End If
Next i

End Sub
'<<======================

Thanks for this, but I don't follow some of it - are 'Long' and 'Double'
worksheet functions?

I'm using Excel 2002 and I don't recognise them.
--
Paul Hyett, Cheltenham



  #5   Report Post  
Paul Hyett
 
Posts: n/a
Default

In microsoft.public.excel.misc on Sat, 6 Aug 2005 at 20:49:39, Norman
Jones wrote :
Hi Paul,

My suggestion was to use a VBA procedure to acieve your objective.


Oh, right.

Unfortunately I've never used it.

If You are not familiar with macros (aka procedures)


I've used them occasionally, but I can't pretend to be proficient with
them.
--
Paul Hyett, Cheltenham


  #6   Report Post  
Norman Jones
 
Posts: n/a
Default

Hi Paul,

I've used them occasionally, but I can't pretend to be proficient with
them.


you may wish to visit David McRitchie's 'Getting Started With Macros And
User Defined Functions' at:

http://www.mvps.org/dmcritchie/excel/getstarted.htm


If you would like the example macro adapted to perfom your desired tasks,
post back with the following information:

(1) The name of the two worksheets
(2) The address of the initial data cells
(3) The exact formula that you are feeding the value into
(4) The address of the cells which are to receive the calculated results.


---
Regards,
Norman



"Paul Hyett" wrote in message
...
In microsoft.public.excel.misc on Sat, 6 Aug 2005 at 20:49:39, Norman
Jones wrote :
Hi Paul,

My suggestion was to use a VBA procedure to acieve your objective.


Oh, right.

Unfortunately I've never used it.

If You are not familiar with macros (aka procedures)


I've used them occasionally, but I can't pretend to be proficient with
them.
--
Paul Hyett, Cheltenham



  #7   Report Post  
Paul Hyett
 
Posts: n/a
Default

In microsoft.public.excel.misc on Sun, 7 Aug 2005 at 10:14:55, Norman
Jones wrote :
Hi Paul,

I've used them occasionally, but I can't pretend to be proficient with
them.


you may wish to visit David McRitchie's 'Getting Started With Macros And
User Defined Functions' at:

http://www.mvps.org/dmcritchie/excel/getstarted.htm


If you would like the example macro adapted to perfom your desired tasks,
post back with the following information:

(1) The name of the two worksheets
(2) The address of the initial data cells
(3) The exact formula that you are feeding the value into
(4) The address of the cells which are to receive the calculated results.

Thanks, but I have figured out a way to do it now.
--
Paul Hyett, Cheltenham
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"