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: 343
Default Declare a Public Array

Per Jessen has provided me with a great deal of help, and one of the thinks
he has helped me with is to use an array of ranges not separate variables.
Among the lines of code he has provided one was:

Dim rngArr() As Range

It became apparent in the course of my work that I would need to refer to
that array in additional modules that were called from the userform in which
rngArr() As Range dimensioned. He told me to declare rngArr() As Range as
public and outside the module. By outside the module I assumed that to mean
that the line Public rngArr() As Range should be placed above all other
code for the userform (before the first sub routine).

I have done that but get the following error message:

Compile Error

Constants, fixed-length strings, arrays, user-defined types and Declare
Statements not allowed as Public members or object modules


So is there any way in which to declare this array as Public? Below is
everything I am declaring (what I believe to be outside the module) above
the first sub routine.


Option Explicit
Dim rMyCell As Range
Public rng As Range
Dim c As Range
Dim Counter As Long
Dim myRng As Range
Dim my1Rng As Range
Public MissData As Boolean
Public BlkProc As Boolean


Private Sub ComboBox1001_Change()

 
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
Declare and Set Public variables jlclyde Excel Discussion (Misc queries) 2 January 28th 09 02:16 PM
how to declare a public workbook? choi4u Excel Programming 3 May 19th 08 03:25 PM
Public declare for Set.... zapatista66[_17_] Excel Programming 2 September 30th 05 01:29 PM
How to declare variable as public. Mark Excel Programming 3 April 7th 05 06:27 PM
PUBLIC DECLARE N10 Excel Programming 0 December 24th 04 06:50 PM


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