|
Problem using VB in Excel 2000
Author |
Message |
James25 #1 / 4
|
 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 |
|
 |
BobW #2 / 4
|
 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 |
|
 |
Jennif #3 / 4
|
 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 |
|
 |
James25 #4 / 4
|
 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 |
|
|
|