Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 46
Default Global variables

How can I set up a global variable like:

Public lh as Integer

???
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Global variables

Put it in a standard module before any subs for udf's
--
Gary's Student


"Ed" wrote:

How can I set up a global variable like:

Public lh as Integer

???

  #3   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 46
Default Global variables


Did that and solved the ptoblem. Thanks for replying.


Ed English



On Sun, 19 Nov 2006 08:51:02 -0800, Gary''s Student
wrote:

Put it in a standard module before any subs for udf's

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Global variables

In general, global variables are not necessary, and if possible are best
avoided. Why do you think you need one?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Ed" wrote in message
...
How can I set up a global variable like:

Public lh as Integer

???



  #5   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 46
Default Global variables

Thanks for reply. I'll be using the calculated variable to be used in
a procedure that would will be run 55 times. Rather than calculate it
55 times, I calculate it as once as a public.



On Sun, 19 Nov 2006 17:14:47 -0000, "Bob Phillips"
wrote:

In general, global variables are not necessary, and if possible are best
avoided. Why do you think you need one?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Global variables

Ed,

You do it exactly the way you have it below. Just be sure you have it in a
regular code module (in the VBA editor, Insert menu, Module). Don't put the
variable declaration in an object module (ThisWorkbook, the Sheets, a
UserForm, or a Class module).


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

"Ed" wrote in message
...
How can I set up a global variable like:

Public lh as Integer

???



  #7   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 46
Default Global variables

Thanks for a code module did the trick. thanks again.

Ed English



On Sun, 19 Nov 2006 11:42:13 -0600, "Chip Pearson"
wrote:

Ed,

You do it exactly the way you have it below. Just be sure you have it in a
regular code module (in the VBA editor, Insert menu, Module). Don't put the
variable declaration in an object module (ThisWorkbook, the Sheets, a
UserForm, or a Class module).

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
global variables Nicolas Roth Excel Programming 3 September 25th 06 04:40 PM
global variables Mike Archer Excel Programming 4 May 3rd 06 07:33 PM
Global Variables mattsvai[_11_] Excel Programming 4 February 3rd 06 05:02 PM
Global Variables Francis Brown Excel Programming 9 November 27th 05 06:14 PM
global variables [email protected] Excel Programming 3 November 16th 05 11:44 PM


All times are GMT +1. The time now is 01:26 AM.

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"