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: 3
Default public array

I have this script

public tMonths
Sub LoadMonths()

Set shtMesi = Workbooks(w).Sheets(sht)
LastRow = shtM.Cells.SpecialCells(xlCellTypeLastCell).Row
LastCol = shtM.Cells(1, 255).End(xlToLeft).Column

ReDim tMonths(LastRow, LastCol)
For R = 1 To LastRow
For C = 1 To LastCol
tMonths(R, C) = shtMesi.Cells(R C)
Next
next

end sub


If i write this

public tMonths
Sub LoadMonths()
Dim lRange As Range
Dim tMonths as Variant
Set lRange = workbooks(w).sheets(sht).Range(range)
tMonths = lRange.value
end sub

and i try to call from another macro i get error using tMonths
What do i wrong?



 
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
Dim vs. Public Jason Morin Excel Programming 7 January 27th 05 01:13 PM
Array of Public Arrays Hari Prasadh Excel Programming 1 January 21st 05 03:42 PM
How to reference a public array (declared in module) from a proced Amzee Excel Programming 3 January 11th 05 06:26 PM
declaring a public array JT[_2_] Excel Programming 3 July 27th 04 11:18 PM
Public Array Brent McIntyre Excel Programming 5 September 23rd 03 12:53 AM


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