LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Display value of a VBA variable inside a cell

Hi,

I am using Excel 2007. I have created a VBA module called MyModule. Inside
this module, I have defined a public variable as follows:

Public blnMyBoolean As Boolean

Next, I created a Function to return the value of this variable as follows:

Public Function GetMyBoolean() As Boolean
GetMyBoolean = blnMyBoolean
End Function

Next, I used my function as a formula for a cell on one of my worksheets as
follows:

=GetMyBoolean()

The formula in this cell works, but it does not update automatically. If my
code changes the value of blnMyBoolean, the only way I can seem to get the
value of my cell (from the formula) to update is to select the cell, click at
the end of the formula in the formula bar, and then click "Enter".

Can anyone tell me if there is a way I can have the value of my cell (from
the formula) to be updated constantly (or at least any time my code changes
the value of blnMyBoolean)?

If I am no going about this in the best way and someone has a better/easier
way for me to have a cell reflect the value of a variable inside my VBA code,
any advice will be greatly appreciated.

Thanks in advance,
Paul




--
Paul Kraemer
 
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
display dots inside a cell in graph form but without Excel graph? Rich Excel Programming 5 November 20th 09 10:12 PM
Variable inside function range dna1711 Excel Programming 3 August 6th 08 01:46 AM
Variable inside a formula [email protected] Excel Programming 0 October 6th 06 12:59 PM
Variable with no Value inside Macro Equation?? TEAM Excel Programming 2 June 1st 05 07:13 PM
variable inside a formula? Phil Excel Programming 5 July 28th 04 12:04 AM


All times are GMT +1. The time now is 09:42 PM.

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

About Us

"It's about Microsoft Excel"