Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Paste special values and formats

Below is the code I am using. I have several workbooks open. One of the
workbooks, "po-info.xls", is used to compile information copied from the
others. After the information is copied, that workbook is closed. The same
procedure is continued with the next workbook until information from all
workbooks is copied to "po-info.xls".

I need to save the "values" and the "formats" of the copied information in
the "po-info.xls" file. I have tried several arrangements of the
"xlpasteformats" without success.

Help!

Sub info()
Application.DisplayAlerts = False
Dim a
a = InputBox("Enter date = mm/dd/yy")
Dim lop As Long
Dim Number As Long
Number = Workbooks.Count
For lop = 1 To Number
If Not ActiveWorkbook.Name = "po-info.xls" Then
Worksheets("po").Range("s9").Value = a
ActiveWorkbook.Worksheets("info").Range("a1:g23"). Copy
Workbooks("po-info.xls").Worksheets("po-info"). _
Range("a1").End(xlDown).Offset(1, 0).PasteSpecial _
Paste:=xlValues
Application.CutCopyMode = False
ActiveWorkbook.Close savechanges:=False
End If
ActiveWindow.ActivateNext
Next lop
ActiveCell.Range("a1").Select
Range("a1:a2").EntireRow.Delete
Workbooks("po-info.xls").SaveAs Filename:="po_upload.prn", _
FileFormat:=xlTextPrinter
ActiveWindow.Close savechanges:=True
Application.DisplayAlerts = True
End Sub

--
l-hawk
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Paste special values and formats

I have been successful by replacing the following:

Workbooks("po-info.xls").Worksheets("po-info"). _
Range("a1").End(xlDown).Offset(1, 0).PasteSpecial _
Paste:=xlValues

With:

With Workbooks("po-info.xls").Worksheets("po-info"). _
Range("a1").End(xlDown).Offset(1, 0)
.PasteSpecial xlValues
.PasteSpecial xlFormats
End With


--
l-hawk


"hawki" wrote:

Below is the code I am using. I have several workbooks open. One of the
workbooks, "po-info.xls", is used to compile information copied from the
others. After the information is copied, that workbook is closed. The same
procedure is continued with the next workbook until information from all
workbooks is copied to "po-info.xls".

I need to save the "values" and the "formats" of the copied information in
the "po-info.xls" file. I have tried several arrangements of the
"xlpasteformats" without success.

Help!

Sub info()
Application.DisplayAlerts = False
Dim a
a = InputBox("Enter date = mm/dd/yy")
Dim lop As Long
Dim Number As Long
Number = Workbooks.Count
For lop = 1 To Number
If Not ActiveWorkbook.Name = "po-info.xls" Then
Worksheets("po").Range("s9").Value = a
ActiveWorkbook.Worksheets("info").Range("a1:g23"). Copy
Workbooks("po-info.xls").Worksheets("po-info"). _
Range("a1").End(xlDown).Offset(1, 0).PasteSpecial _
Paste:=xlValues
Application.CutCopyMode = False
ActiveWorkbook.Close savechanges:=False
End If
ActiveWindow.ActivateNext
Next lop
ActiveCell.Range("a1").Select
Range("a1:a2").EntireRow.Delete
Workbooks("po-info.xls").SaveAs Filename:="po_upload.prn", _
FileFormat:=xlTextPrinter
ActiveWindow.Close savechanges:=True
Application.DisplayAlerts = True
End Sub

--
l-hawk

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
Keyboard Shortcuts for Paste Special Values and Formats Scott Excel Discussion (Misc queries) 3 May 20th 23 11:41 AM
Paste special from cells without formulas/formats Spartacus Excel Worksheet Functions 2 April 11th 08 04:16 PM
Formats-Paste special pamble Excel Discussion (Misc queries) 1 November 8th 07 06:36 PM
Conditional formats- paste special formats? jcarney Excel Discussion (Misc queries) 1 November 1st 07 06:37 PM
Dynamic Copy/Paste Special Formulas/Paste Special Values Sharon Perez Excel Programming 3 August 7th 04 09:49 PM


All times are GMT +1. The time now is 11:05 PM.

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"