Problem using VB in Excel 2000 
Author Message
 Problem using VB in Excel 2000

Hi All,

I've written a macro that copies some information from a large worksheet
(Over 35000 cells) and pastes the information on another worksheet (In the
same workbook).

The macro works fine on my PC at home, which uses Excel 97 but when I try
and use the same macro in a worksheet that was created in Excel 2000 it
throws up a error. I can't understand what is wrong with the line, all the
variables seem to be within acceptable limits and the worksheets are named
correctly. Anyway the line that's giving me problems is

Sheet2.Cells(Index, "A") = Sheet1.Cells(rowcount - 1, "A")

If necessary I can supply more of the code, it's not very nice but is works
for me!

Any suggestions appreciated.
James

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ( http://www.*-*-*.com/ ).
Version: 6.0.476 / Virus Database: 273 - Release Date: 24/04/2003



Sun, 16 Oct 2005 17:26:00 GMT  
 Problem using VB in Excel 2000

Quote:
> Hi All,

> I've written a macro that copies some information from a large worksheet
> (Over 35000 cells) and pastes the information on another worksheet (In the
> same workbook).

> The macro works fine on my PC at home, which uses Excel 97 but when I try
> and use the same macro in a worksheet that was created in Excel 2000 it
> throws up a error. I can't understand what is wrong with the line, all the
> variables seem to be within acceptable limits and the worksheets are named
> correctly. Anyway the line that's giving me problems is

> Sheet2.Cells(Index, "A") = Sheet1.Cells(rowcount - 1, "A")

What is the error given?  Off the top of my head, I would suggest trying
Range
instead of Cells, but that is an uneducated guess.

Quote:
> If necessary I can supply more of the code, it's not very nice but is
works
> for me!

> Any suggestions appreciated.
> James

> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.476 / Virus Database: 273 - Release Date: 24/04/2003



Mon, 17 Oct 2005 22:37:51 GMT  
 Problem using VB in Excel 2000
James,

I've had a problem like this before.  In my case, I added the Value
property to the code and it worked after that.

Sheet2.Cells(Index, "A").Value = Sheet1.Cells(rowcount - 1, "A").Value

On the other hand, Excel seems to be finicky rather often.  So it
might be something else.  What was the exact error message?  It might
be helpful if you posted the rest of the code as well.

Jennifer

Quote:

> Hi All,

> I've written a macro that copies some information from a large worksheet
> (Over 35000 cells) and pastes the information on another worksheet (In the
> same workbook).

> The macro works fine on my PC at home, which uses Excel 97 but when I try
> and use the same macro in a worksheet that was created in Excel 2000 it
> throws up a error. I can't understand what is wrong with the line, all the
> variables seem to be within acceptable limits and the worksheets are named
> correctly. Anyway the line that's giving me problems is

> Sheet2.Cells(Index, "A") = Sheet1.Cells(rowcount - 1, "A")

> If necessary I can supply more of the code, it's not very nice but is works
> for me!

> Any suggestions appreciated.
> James

> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.476 / Virus Database: 273 - Release Date: 24/04/2003



Tue, 18 Oct 2005 01:24:50 GMT  
 Problem using VB in Excel 2000
Hi Jennifer,

Thanks for the suggestion, problem solved!

Much appreciated,
James

Please note - E-mail address corrupt. To reply change the "no" to "i"


Quote:
> James,

> I've had a problem like this before.  In my case, I added the Value
> property to the code and it worked after that.

> Sheet2.Cells(Index, "A").Value = Sheet1.Cells(rowcount - 1, "A").Value

> On the other hand, Excel seems to be finicky rather often.  So it
> might be something else.  What was the exact error message?  It might
> be helpful if you posted the rest of the code as well.

> Jennifer




Quote:
> > Hi All,

> > I've written a macro that copies some information from a large worksheet
> > (Over 35000 cells) and pastes the information on another worksheet (In
the
> > same workbook).

> > The macro works fine on my PC at home, which uses Excel 97 but when I
try
> > and use the same macro in a worksheet that was created in Excel 2000 it
> > throws up a error. I can't understand what is wrong with the line, all
the
> > variables seem to be within acceptable limits and the worksheets are
named
> > correctly. Anyway the line that's giving me problems is

> > Sheet2.Cells(Index, "A") = Sheet1.Cells(rowcount - 1, "A")

> > If necessary I can supply more of the code, it's not very nice but is
works
> > for me!

> > Any suggestions appreciated.
> > James

> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.476 / Virus Database: 273 - Release Date: 24/04/2003

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.476 / Virus Database: 273 - Release Date: 24/04/2003


Tue, 18 Oct 2005 15:57:39 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Compatibility Problem Using MS Excel 97 VBA on Excel 2000/XP - Causes crashes

2. Need Help Manipulating Excel 2000 from Access 2000 using VBA

3. Importing Excel Spreadsheet into an Access 2000 Table using VB

4. read excel file in access 2000 lire fichier excel dans access 2000

5. saving data from a VB form to access 2000 or excel 2000

6. Problem in vb using vba Commands for Word 2000

7. Problems Using VB 6.0 Data controls with Access 2000

8. using Excel Functions in Access 2000

9. Automation error using Access and Excel 2000

10. Excel 2000: Using INSERT statement in QueryTable query fails

11. Using the Status Bar in MS Excel 2000

12. Unable to import SAS data into ACCESS97 or EXCEL 2000 using the SAS ODBC driver

 

 
Powered by phpBB® Forum Software