View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default First Time VBA user- really easy question :-)

The code must be in a regular code module (create from Insert menu in VBA)
in the same workbook as the sheet from which you are calling the function.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"cappy2112" wrote in message
ps.com...
On Jun 18, 12:02 pm, "Chip Pearson" wrote:
You can't directly read the version number from a worksheet cell. You
need a
function in a module (create from "Insert" menu in VBA) that will read
the
constant and return its value to the worksheet cell. E.g.,

Public Function GetVersion()
GetVersion = ProgramVersionNumber
End Function

Then, you can call this from a worksheet cell with

=GetVersion()


Ok- I've tried this, but the spreadsheet still shows #NAME?

Public Function GetVersion()
GetVersion = ProgramVersionNumber
End Function