Copying an array to a worksheet: Excel 97 vs 2000

  • Thread starter Thread starter Trevor Shuttleworth
  • Start date Start date
T

Trevor Shuttleworth

Dear all

I am accumulating monthly totals in a an array defined as:

Dim MonthTotal(1 To 12) As Variant

The following single line of code works in Excel 2000:

SheetCell.Offset(0, 1).Resize(, 12) = MonthTotal

But, in Excel 97 at work, for some reason it creates text values with $
signs (followed by a space)
So, instead, I've had to resort to this:

For i = 1 To 12
SheetCell.Offset(0, i) = MonthTotal(i)
Next 'i

It's not a problem as such as I've found a workaround. However, I would
like to understand what, if anything, I'm doing wrong ... or is this a
difference between Excel 97 and Excel 2000 ?

Regards

Trevor
 
Just a guess--I don't have xl97 anymore:

SheetCell.Offset(0, 1).Resize(, 12).Value = MonthTotal

(but it won't take too long to find out if it worked.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top