Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How to send a variable from a VB Module to an excel spreadsheet ce

Could someone post the solution of how to send a variable, theta_eff, to an
Excel cell named Theta?

Thanks!

B
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to send a variable from a VB Module to an excel spreadsheet ce

worksheets("somesheetnamehere").range("theta").val ue = theta_eff

is one way.

Beavoid wrote:

Could someone post the solution of how to send a variable, theta_eff, to an
Excel cell named Theta?

Thanks!

B


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How to send a variable from a VB Module to an excel spreadshee

Here is a snippet of what I am trying, with no results so far (no errors
either), but that could be because I haven't yet translated all of the rest
of the code:

Function BearingOutputs() As Double
Worksheets("Outputs").Range("Theta").Value = theta_eff
Worksheets("Outputs").Range("EccentricityRatio").V alue = ecc
Worksheets("Outputs").Range("AttitudeAngle").Value = att

Where Outputs is the name of the Excel worksheet tab within the file (should
it be the filename, instead?). Do I have to place anything else in the
function call?

Also, do I have to do anything to the Theta Excel cell in order to make it
take the sent variable value?

Thanks for the help!

B

"Dave Peterson" wrote:

worksheets("somesheetnamehere").range("theta").val ue = theta_eff

is one way.

Beavoid wrote:

Could someone post the solution of how to send a variable, theta_eff, to an
Excel cell named Theta?

Thanks!

B


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to send a variable from a VB Module to an excel spreadshee

If this is a function called from a cell on a worksheet, then this won't work.
UDFs called from a cell in a worksheet can only return a value to the cell that
contains that function (with minor exceptions).

If this is called by a subroutine, then maybe the variables don't have anything
in them (yet). I don't see how they were declared and how they were populated.

Beavoid wrote:

Here is a snippet of what I am trying, with no results so far (no errors
either), but that could be because I haven't yet translated all of the rest
of the code:

Function BearingOutputs() As Double
Worksheets("Outputs").Range("Theta").Value = theta_eff
Worksheets("Outputs").Range("EccentricityRatio").V alue = ecc
Worksheets("Outputs").Range("AttitudeAngle").Value = att

Where Outputs is the name of the Excel worksheet tab within the file (should
it be the filename, instead?). Do I have to place anything else in the
function call?

Also, do I have to do anything to the Theta Excel cell in order to make it
take the sent variable value?

Thanks for the help!

B

"Dave Peterson" wrote:

worksheets("somesheetnamehere").range("theta").val ue = theta_eff

is one way.

Beavoid wrote:

Could someone post the solution of how to send a variable, theta_eff, to an
Excel cell named Theta?

Thanks!

B


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How to send a variable from a VB Module to an excel spreadshee

The way it is supposed to work is this:

There are two sheets
One worksheet has several cell values that the user inputs.
Then a function takes those inputed values, makes calculations, and spits
out the variables I have been talking about into a second sheet of cells.
(These variables have been predefined Public prior to the functions in the VB
module.)


"Dave Peterson" wrote:

If this is a function called from a cell on a worksheet, then this won't work.
UDFs called from a cell in a worksheet can only return a value to the cell that
contains that function (with minor exceptions).

If this is called by a subroutine, then maybe the variables don't have anything
in them (yet). I don't see how they were declared and how they were populated.

Beavoid wrote:

Here is a snippet of what I am trying, with no results so far (no errors
either), but that could be because I haven't yet translated all of the rest
of the code:

Function BearingOutputs() As Double
Worksheets("Outputs").Range("Theta").Value = theta_eff
Worksheets("Outputs").Range("EccentricityRatio").V alue = ecc
Worksheets("Outputs").Range("AttitudeAngle").Value = att

Where Outputs is the name of the Excel worksheet tab within the file (should
it be the filename, instead?). Do I have to place anything else in the
function call?

Also, do I have to do anything to the Theta Excel cell in order to make it
take the sent variable value?

Thanks for the help!

B

"Dave Peterson" wrote:

worksheets("somesheetnamehere").range("theta").val ue = theta_eff

is one way.

Beavoid wrote:

Could someone post the solution of how to send a variable, theta_eff, to an
Excel cell named Theta?

Thanks!

B

--

Dave Peterson


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How to send a variable from a VB Module to an excel spreadshee

You were correct, I believe, in suggesting the subroutine. I haven't gotten
it all to work right, but I think I am on the correct path now.

Thanks!

B

"Dave Peterson" wrote:

If this is a function called from a cell on a worksheet, then this won't work.
UDFs called from a cell in a worksheet can only return a value to the cell that
contains that function (with minor exceptions).

If this is called by a subroutine, then maybe the variables don't have anything
in them (yet). I don't see how they were declared and how they were populated.

Beavoid wrote:

Here is a snippet of what I am trying, with no results so far (no errors
either), but that could be because I haven't yet translated all of the rest
of the code:

Function BearingOutputs() As Double
Worksheets("Outputs").Range("Theta").Value = theta_eff
Worksheets("Outputs").Range("EccentricityRatio").V alue = ecc
Worksheets("Outputs").Range("AttitudeAngle").Value = att

Where Outputs is the name of the Excel worksheet tab within the file (should
it be the filename, instead?). Do I have to place anything else in the
function call?

Also, do I have to do anything to the Theta Excel cell in order to make it
take the sent variable value?

Thanks for the help!

B

"Dave Peterson" wrote:

worksheets("somesheetnamehere").range("theta").val ue = theta_eff

is one way.

Beavoid wrote:

Could someone post the solution of how to send a variable, theta_eff, to an
Excel cell named Theta?

Thanks!

B

--

Dave Peterson


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to send a variable from a VB Module to an excel spreadshee

You may be able to use a worksheet_change event that runs each time one of those
input cells is changed by the user.

But personally, I think I'd allow the user to enter all the data (and double
check it!), then click a button from the forms toolbar that would call that
macro.

Beavoid wrote:

You were correct, I believe, in suggesting the subroutine. I haven't gotten
it all to work right, but I think I am on the correct path now.

Thanks!

B

"Dave Peterson" wrote:

If this is a function called from a cell on a worksheet, then this won't work.
UDFs called from a cell in a worksheet can only return a value to the cell that
contains that function (with minor exceptions).

If this is called by a subroutine, then maybe the variables don't have anything
in them (yet). I don't see how they were declared and how they were populated.

Beavoid wrote:

Here is a snippet of what I am trying, with no results so far (no errors
either), but that could be because I haven't yet translated all of the rest
of the code:

Function BearingOutputs() As Double
Worksheets("Outputs").Range("Theta").Value = theta_eff
Worksheets("Outputs").Range("EccentricityRatio").V alue = ecc
Worksheets("Outputs").Range("AttitudeAngle").Value = att

Where Outputs is the name of the Excel worksheet tab within the file (should
it be the filename, instead?). Do I have to place anything else in the
function call?

Also, do I have to do anything to the Theta Excel cell in order to make it
take the sent variable value?

Thanks for the help!

B

"Dave Peterson" wrote:

worksheets("somesheetnamehere").range("theta").val ue = theta_eff

is one way.

Beavoid wrote:

Could someone post the solution of how to send a variable, theta_eff, to an
Excel cell named Theta?

Thanks!

B

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
i want to send the document via the excel spreadsheet Neil Excel Discussion (Misc queries) 1 March 25th 08 04:08 AM
What format do I use to send an excel spreadsheet from a PC to a . cass-ba Excel Discussion (Misc queries) 2 February 28th 08 08:01 PM
Macro to send excel spreadsheet Steve Excel Discussion (Misc queries) 4 May 1st 07 11:56 PM
why can't i send my excel spreadsheet? perplexed Excel Worksheet Functions 1 February 19th 06 06:45 AM
Variable from a sheet module in a class module in XL XP hglamy[_2_] Excel Programming 2 October 14th 03 05:48 PM


All times are GMT +1. The time now is 10:23 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"