LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default VBA For Excel - Copy Paste Values only.

Hello,
I am trying to consolidate a number of worksheets into one "combined"
worksheet. I've been able to get the following code to work but I want to
modify it to paste values only. Can I have your thoughts on how this might
be done?

Thanks:

Sub Combine()
Dim J As Integer
Dim k As Integer

On Error Resume Next
Sheets(1).Select
Worksheets.Add ' add a sheet in first place
Sheets(1).Name = "Combined"

' work through sheets
For J = 10 To Sheets.Count ' from sheet 2 to last sheet
Sheets(J).Activate ' make the sheet active
Range("A1:A1").Select
For k = 1 To 201
Selection.Copy Destination:=Sheets(1).Rows(k + 201 * (J -
10)).Columns(1)
Next k
Sheets(J).Activate
Range("a10:d210").Select
Selection.Copy Destination:=Sheets(1).Rows((J - 10) * 201 +
1).Columns(2)
Next J
End Sub


 
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
Macro for copy and paste values excelnerd Excel Discussion (Misc queries) 3 March 8th 08 06:51 PM
Copy / Paste Special / Values for a whole spreadsheet ? Colin2 Excel Discussion (Misc queries) 4 May 23rd 06 05:11 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
Copy and paste special - values into new excel file [email protected] Excel Discussion (Misc queries) 1 October 12th 05 11:02 PM
copy-paste as Values automatically Anand Excel Worksheet Functions 0 September 23rd 05 07:10 PM


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

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"