Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default Copy and paste special - values into new excel file

Hi,

I am completely new to excel programming. I have a SQL DTS which
creates an excel file and exports data into it. The created excel file
could have variable number of work sheets.

Text data in the excel file had a leading single quote character and
spaces before the data. I can get rid of these by copying entire sheet
and paste special--values into a new sheet.

Would some one tell me how to automate to create a new excel file and
copy and paste special (with values option) all the work sheets into
the new file? I appreciate any help.

  #2   Report Post  
Jim Rech
 
Posts: n/a
Default

Any reason not to paste the data right on top of itself (the usual way).

Sub a()
Dim WS As Worksheet
For Each WS In Worksheets
WS.Cells.Copy
WS.Cells(1).PasteSpecial xlPasteValues
Next
End Sub


--
Jim
wrote in message
oups.com...
| Hi,
|
| I am completely new to excel programming. I have a SQL DTS which
| creates an excel file and exports data into it. The created excel file
| could have variable number of work sheets.
|
| Text data in the excel file had a leading single quote character and
| spaces before the data. I can get rid of these by copying entire sheet
| and paste special--values into a new sheet.
|
| Would some one tell me how to automate to create a new excel file and
| copy and paste special (with values option) all the work sheets into
| the new file? I appreciate any help.
|


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
Can't Copy and Paste or Paste Special between Excel Workbooks wllee Excel Discussion (Misc queries) 5 April 29th 23 03:43 AM
Can't Copy and Paste between Excel 2003 Workbooks wllee Excel Discussion (Misc queries) 6 March 30th 05 02:59 PM
Keyboard shortcut for "copy paste special values?" Star AJ Excel Discussion (Misc queries) 2 March 17th 05 04:03 PM
paste special (values) AJPendragon Excel Worksheet Functions 0 February 22nd 05 03:19 PM
Paste Special values only AJPendragon Excel Worksheet Functions 1 February 22nd 05 11:05 AM


All times are GMT +1. The time now is 11:38 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"