try this...

Option Explicit
Dim myarray(1) As Variant
Sub PublicArrayExample()
'Dim myarray(2) As String
'Fill the array MyArray with values.
myarray(0) = "Hello"
myarray(1) = "Goodbye"

'Run the TestPublicArrayExample macro to display MyArray.
Call TestPublicArrayExample

End Sub

Sub TestPublicArrayExample()
'Display the values contained in the array MyArray.
Dim i As Integer
'UBound returns number of last element in particular column
For i = 0 To UBound(myarray, 1)
MsgBox myarray(i)
Next i
End Sub



Cheers!!

On Wed, Mar 25, 2015 at 3:53 PM, Rohit Jadhav <rohitj...@gmail.com> wrote:

> Hi
> I have a simple question
> I'm trying to declare a public array myarray which can be used by either
> of PublicArrayExample() & TestPublicArrayExample(). But while executing the
> macro I'm facing compiler error. Can you please what is wrong with my
> declaration. Please see the attached files
>
> On Tue, Mar 24, 2015 at 5:06 AM, <excel-macros@googlegroups.com> wrote:
>
>>     excel-macros@googlegroups.com
>> <https://groups.google.com/forum/?utm_source=digest&utm_medium=email#!forum/excel-macros/topics>
>>   Google
>> Groups
>> <https://groups.google.com/forum/?utm_source=digest&utm_medium=email/#!overview>
>> <https://groups.google.com/forum/?utm_source=digest&utm_medium=email/#!overview>
>>   Today's topic summary
>>  View all topics
>> <https://groups.google.com/forum/?utm_source=digest&utm_medium=email#!forum/excel-macros/topics>
>>
>>    -  Tips and Tricks <#14c5075c6bd7ef40_14c48feab238800e_group_thread_0>
>>    - 1 Update
>>    -  how to run SQL Query in Excel to retrive a set of Data.
>>    <#14c5075c6bd7ef40_14c48feab238800e_group_thread_1> - 1 Update
>>    -  Query in code of email send with attachment from excel
>>    <#14c5075c6bd7ef40_14c48feab238800e_group_thread_2> - 2 Updates
>>
>>   Tips and Tricks
>> <http://groups.google.com/group/excel-macros/t/fda971b10be88449?utm_source=digest&utm_medium=email>
>>   Sanjeev Banerjee <sanjibbanerjee1...@gmail.com>: Mar 23 09:31AM -0700
>>
>> Hi
>>
>> Some Tips & Tricks of Excel
>>
>> Attaching some Files
>>
>> Thanks and Regards
>> Sanjeev Banerjee
>> ...more
>> <http://groups.google.com/group/excel-macros/msg/8961e565af095311?utm_source=digest&utm_medium=email>
>>   Back to top <#14c5075c6bd7ef40_14c48feab238800e_digest_top>
>>   how to run SQL Query in Excel to retrive a set of Data.
>> <http://groups.google.com/group/excel-macros/t/4abbb7154f6f2df1?utm_source=digest&utm_medium=email>
>>   Rakesh kumar <rakesh.apt...@gmail.com>: Mar 23 08:08PM +0530
>>
>> Hi,
>>
>> I want to run SQL Query in Excel to retrive a set of Data.
>>
>> Currently i am executing a query in Sql then copied the output and pasted
>> into excel.
>>
>> Now i want to direct Execution of query ...more
>> <http://groups.google.com/group/excel-macros/msg/8f7aebec9494325f?utm_source=digest&utm_medium=email>
>>   Back to top <#14c5075c6bd7ef40_14c48feab238800e_digest_top>
>>   Query in code of email send with attachment from excel
>> <http://groups.google.com/group/excel-macros/t/35938998bb63993e?utm_source=digest&utm_medium=email>
>>   Ashish Bhalara <ashishbhalar...@gmail.com>: Mar 23 05:00PM +0530
>>
>> Dear experts,
>>
>> See the attached file of email sending from excel. Normally mail send
>> successfully to all together from database. I need attached file to some
>> of
>> party so I add column 'Attachment ...more
>> <http://groups.google.com/group/excel-macros/msg/16db303475b09f39?utm_source=digest&utm_medium=email>
>>   Vaibhav Joshi <v...@vabs.in>: Mar 23 06:30PM +0530
>>
>> Before adding att check if attachment exists or not, if its null then you
>> will get error...
>>
>> Cheers!!
>>
>> On Mon, Mar 23, 2015 at 5:00 PM, Ashish Bhalara <
>> ashishbhalar...@gmail.com>
>> wrote:
>>
>> ...more
>> <http://groups.google.com/group/excel-macros/msg/466039c4aef07f4d?utm_source=digest&utm_medium=email>
>>   Back to top <#14c5075c6bd7ef40_14c48feab238800e_digest_top>
>>    You received this digest because you're subscribed to updates for
>> this group. You can change your settings on the group membership page
>> <https://groups.google.com/forum/?utm_source=digest&utm_medium=email#!forum/excel-macros/join>
>> .
>> To unsubscribe from this group and stop receiving emails from it send an
>> email to excel-macros+unsubscr...@googlegroups.com.
>>
>
>
>
> --
> With Regards,
> Rohit Jadhav.
>
> --
> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
> https://www.facebook.com/discussexcel
>
> FORUM RULES
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.
> 2) Don't post a question in the thread of another member.
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
> 4) Acknowledge the responses you receive, good or bad.
> 5) Jobs posting is not allowed.
> 6) Sharing copyrighted material and their links is not allowed.
>
> NOTE : Don't ever post confidential data in a workbook. Forum owners and
> members are not responsible for any loss.
> ---
> You received this message because you are subscribed to the Google Groups
> "MS EXCEL AND VBA MACROS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to excel-macros+unsubscr...@googlegroups.com.
> To post to this group, send email to excel-macros@googlegroups.com.
> Visit this group at http://groups.google.com/group/excel-macros.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to