View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
cappy2112 cappy2112 is offline
external usenet poster
 
Posts: 13
Default First Time VBA user- really easy question :-)


I'm maintaining some VBA code for Excel 2003, developed by a person no
longer employed where I work.

This code contains several small forms, and work sheets.

One the main worksheet, there are several command buttons, (and the
event handlers for these buttons as well)

I want to add a version number to the program, so that the string
variable is defined as a constant in the VB code, but is displayed on
the main worksheet.

I've defined the constant as follows
Private Const ProgramVersionNumber As String = "1.1"

Now, I want to display this in a cell on the main worksheet.

1. How do I print/display the value of this variable (from the VB
code) in Cell A1, ?
2. Can I reference this variable (or any variables in the VB code)
from the worksheet? If so, what is the syntax for doing this?
I've tried entering =ProgramVersionNumber in Cell A1, but that doesn't
work.

I could use some beginners references for Excel VBA.

I'm pretty comfortable with Visual Basic (VB6 to be precise), but I
rarely work with Excel, let alone driving Excel from VBA code.

thanks