LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default clipboard cannot be emptied


The following macro is my crude solution (I sense there may be a much
more efficient way to do this) to a need in a multi-line file to insert
99 copies of each line between the existing lines; so a 10 line file
becomes a 1000 line file, etc. The macro works on the 1000 line
example, but when I tried it on a 20,000 line test file I got an error
that the 'clipboard cannot be emptied', debug revealed it was on the
line with stars below that the error was occuring. How do I deal with
that? Or, alternatively, is there a much better way to achieve the same
results?

Thanks in advance,

Rob

Sub Interpolate_NIRS()
numlines = Range("A1").SpecialCells(xlCellTypeLastCell).Row
MsgBox numlines
Application.ScreenUpdating = False
For j = 1 To numlines
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Copy
For k = 1 To 99
ActiveCell.Range("A1:B1").Select
Selection.Copy
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.Insert Shift:=xlDown
**** Next
ActiveCell.Offset(1, 0).Range("A1").Select
Next
Application.ScreenUpdating = True
numlines = Range("A1").SpecialCells(xlCellTypeLastCell).Row
MsgBox numlines
End Sub


--
rroach
------------------------------------------------------------------------
rroach's Profile: http://www.excelforum.com/member.php...o&userid=21093
View this thread: http://www.excelforum.com/showthread...hreadid=380048

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where does Ms XL store the clipboard ? or where does MS Windowsstore clipboard ? Subu Setting up and Configuration of Excel 1 May 18th 09 06:56 AM
Where does Ms XL store the clipboard ? or where does MS Windowsstore clipboard ? Subu Setting up and Configuration of Excel 0 May 5th 09 01:20 PM
Clipboard empty but still get waring that clipboard is full Steve Excel Discussion (Misc queries) 0 June 17th 08 09:05 PM
Clipboard childothe1980s Excel Discussion (Misc queries) 1 July 13th 06 09:33 PM
clipboard sam Excel Programming 1 June 4th 04 02:55 PM


All times are GMT +1. The time now is 12:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"