Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
carl
 
Posts: n/a
Default Automate Copy / PasteSpecial

I have about 40,000 lines in my spreadsheet. For a given column, say column
k, can a macro copy/paste special/values in 1000 row blocks ?

In other words. Starting a K4, copy k4:k1004, paste special / value over
the same range. Then copy k1005:k2000, paste special / value over the same
.. Continue to do this until the last line of data (or until a specified row).

Thank you in advance.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student
 
Posts: n/a
Default Automate Copy / PasteSpecial

To do a single block of 1000 cells:

Sub Macro1()
Dim r As Range
Set r = Range("K4", "K1004")
r.Copy
r.PasteSpecial Paste:=xlPasteValues
End Sub

and rather than loop 100 cells at a time:

Sub Macro2()
Dim r, r2 As Range
Set r2 = Range("K4").End(xlDown)
Set r = Range("K4", r2)
r.Copy
r.PasteSpecial Paste:=xlPasteValues
End Sub
--
Gary''s Student


"carl" wrote:

I have about 40,000 lines in my spreadsheet. For a given column, say column
k, can a macro copy/paste special/values in 1000 row blocks ?

In other words. Starting a K4, copy k4:k1004, paste special / value over
the same range. Then copy k1005:k2000, paste special / value over the same
. Continue to do this until the last line of data (or until a specified row).

Thank you in advance.

Reply
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
Copy without Hidden Cols - How abrogard Excel Discussion (Misc queries) 1 July 15th 05 07:54 AM
reminder notifications in a column L Mieth Excel Discussion (Misc queries) 6 June 10th 05 11:00 AM
Automate copy command? cwilliams Excel Worksheet Functions 0 April 5th 05 06:51 PM
Automate copy command cwilliams Excel Discussion (Misc queries) 0 April 5th 05 06:47 PM
Copy and pasting graphs to PowerPoint JZip Excel Discussion (Misc queries) 0 January 6th 05 08:29 PM


All times are GMT +1. The time now is 01:24 AM.

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

About Us

"It's about Microsoft Excel"