Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default programme variables in excell VBA

Hello

Is there a variable area Text) in Excel VBA precsented under VBA
locals to be used for programmer purpose only (this may not could
interfer with excell or VBA) and how do I accessed it.
ex. me.uservariabes.variables1

it is urgent that this will be saved together with the file.

regards

Kurt
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default programme variables in excell VBA

Application.Names.Add "MYVARIABLE","MYVALUE"

This creates a name/variable MYVARIABLE with the value MYVALUE and it gets
saved with the workbook. BUT only string values may be used. In order to
query the value use:

Evaluate(Application.Names("MYVARIABLE").Value)

Without Evaluate, a formula rather than a value is returned.

Also. consider using Custom properties for variables that you do not want to
shore in cells.

"kurt hansen" wrote:

Hello

Is there a variable area Text) in Excel VBA precsented under VBA
locals to be used for programmer purpose only (this may not could
interfer with excell or VBA) and how do I accessed it.
ex. me.uservariabes.variables1

it is urgent that this will be saved together with the file.

regards

Kurt

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default programme variables in excell VBA

? BUT only string values may be used.

Application.Names.Add "MYVARIABLE",1000

works as well.

Names also have a visible property if you don't want the user to be able to
alter them in Insert=Name=Define (as an example).

--
Regards,
Tom Ogilvy

"AA2e72E" wrote in message
...
Application.Names.Add "MYVARIABLE","MYVALUE"

This creates a name/variable MYVARIABLE with the value MYVALUE and it gets
saved with the workbook. BUT only string values may be used. In order to
query the value use:

Evaluate(Application.Names("MYVARIABLE").Value)

Without Evaluate, a formula rather than a value is returned.

Also. consider using Custom properties for variables that you do not want

to
shore in cells.

"kurt hansen" wrote:

Hello

Is there a variable area Text) in Excel VBA precsented under VBA
locals to be used for programmer purpose only (this may not could
interfer with excell or VBA) and how do I accessed it.
ex. me.uservariabes.variables1

it is urgent that this will be saved together with the file.

regards

Kurt



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default programme variables in excell VBA

No there isn't.

If you want to preserve information across different sessions, there are 3
easy ways

- write it to another file an d the read it back at the session start
- write it to a workbook name and read it back at the start
- write it to a worksheet cell and read it back at the start.

The first two would need to cater for non-existence, the third only for
being empty.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"kurt hansen" wrote in message
om...
Hello

Is there a variable area Text) in Excel VBA precsented under VBA
locals to be used for programmer purpose only (this may not could
interfer with excell or VBA) and how do I accessed it.
ex. me.uservariabes.variables1

it is urgent that this will be saved together with the file.

regards

Kurt



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
the font colour icon in excell 2007 kicks me out of the programme delysia Excel Worksheet Functions 1 July 10th 08 04:35 PM
Referencing other programme GBH99 Setting up and Configuration of Excel 1 February 28th 06 10:06 PM
Linking with other programme Rao Ratan Singh New Users to Excel 1 January 31st 06 07:16 PM
Audit Programme Steved[_3_] Excel Programming 6 September 7th 04 01:58 AM
excel vba programme sarasa[_6_] Excel Programming 3 June 14th 04 07:27 AM


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