Compile error: Array already dimensioned

curious K

New Member
Joined
Dec 28, 2015
Messages
22
Dim GrpTot(1, 2)
'Col 1 : Amt
'Col 2 : row no for Where to put
'col 3 : Column no for where to put




GrpTot(0, 0) = 4896.00
GrpTot(0, 1) = 5
GrpTot(0, 2) = 2


Sheets("Summary").Cells(GrpTot(0, 2), GrpTot(0, 1)) = GrpTot(0, 0)




ReDim Preserve GrpTot(2 To 2)




GrpTot(0, 0) = 12541.00
GrpTot(0, 1) = 5
GrpTot(0, 2) = 18


Sheets("Summary").Cells(GrpTot(0, 2), GrpTot(0, 1)) = GrpTot(0, 0)






Error occured at ReDim syntax
---------------------------
Microsoft Visual Basic for Applications
---------------------------
Compile error:


Array already dimensioned
---------------------------
OK Help
---------------------------
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
To define a dynamic array, don't Dim it with a size:
Rich (BB code):
Dim GrpTot() As Variant
ReDim GrpTot(1,2)

You can't redim preserve the first dimension of an array, only the last
 
Upvote 0

Forum statistics

Threads
1,221,477
Messages
6,160,063
Members
451,615
Latest member
soroosh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top