RIAS
asked on
How to write a macro to copy and paste rows in a worksheet till the limit is reached+excel 2007
Hi,
I need to write a macro in excel to copy and paste the existing rows in excel sheet till the limit of excel is reached.
I want to do a load test on excel 2007 using a software.
Any suggestions are apreciated
Cheers
I need to write a macro in excel to copy and paste the existing rows in excel sheet till the limit of excel is reached.
I want to do a load test on excel 2007 using a software.
Any suggestions are apreciated
Cheers
ASKER
Thanks for that but I am not looking fr tht.I need to test the limit of excel sheet compatibility with an software.So need a excel sheet with the 65536 rows filled.
So just a need a macro which will go on copying and pasting the existing rows in ecel sheet till the limit is reached.
Cheers
So just a need a macro which will go on copying and pasting the existing rows in ecel sheet till the limit is reached.
Cheers
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Cheers mate !!!works like charm
ASKER
Hi,
Just got an error on PasteRange
Sub or function not defined.
Cheers
Just got an error on PasteRange
Sub or function not defined.
Cheers
there should be a space between paste & range !
ASKER
I see.
the problem is the location of the macro. As it relates to a range, it should be placed inside a worksheet section in the vba editor, such as in sheet1.
Now it more or less tries to execute
thisworkbook.range(...) and thisworkbook.paste,
these functions do not exist. (and thus the error message).
when placed in a workSHEET section, the macro executes
worksheet.range(...) and worksheet.paste
these functions do exist.
The other way round, specifying which worksheet to work on also leads to a working situation, eg. by leaving the macro where it is but changing it to
the problem is the location of the macro. As it relates to a range, it should be placed inside a worksheet section in the vba editor, such as in sheet1.
Now it more or less tries to execute
thisworkbook.range(...) and thisworkbook.paste,
these functions do not exist. (and thus the error message).
when placed in a workSHEET section, the macro executes
worksheet.range(...) and worksheet.paste
these functions do exist.
The other way round, specifying which worksheet to work on also leads to a working situation, eg. by leaving the macro where it is but changing it to
Sub test()
On Error Resume Next
worksheets("sheet1").Range("1:1").Copy
While Err = 0
worksheets("sheet1").Paste worksheets("sheet1").Range(worksheets("sheet1").UsedRange.Rows.Count + 1 & ":" & worksheets("sheet1").UsedRange.Rows.Count + 1)
DoEvents
Wend
On Error GoTo 0
End Sub
http://www.mrexcel.com/archive/General/9890b.html