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: 9
Default Copy and pastespecial without formulas

I have the following code which looks into a named range
(emaillist) and copies and pastes certain ranges (defined
in this emaillist range) to another workbook (which I will
later email out. However, the copying and pasting should
only be by value and format. I have included the code in
but it still isn't working for some reason. The ranges
that it is pulling from are noncontinguous hence why I
have the range names listed in the emaillist. Everything
works fine up to the adding and copy but not the
pastespecial feature for some reason. Can anyone help
me...I am so close but yet so far.

Sub Reporting()
Dim a, b, c As String
Dim email As Range
Dim r, y As Integer
Dim wkb, cwkb As Workbook
'
' Macro2 Macro
' Macro recorded 07/25/2003 by Steven Cheng
'

'
a = "Period " & Format(Worksheets("Hotel_Info").Range
("Period").Value, "00")
a = a & ", Day " & Format(Worksheets
("Hotel_Info").Range("Current_day").Value, "00")
a = a & " " & Format(Worksheets("Hotel_Info").Range
("Year").Value, "0000")
a = a & " - " & Format(Worksheets("Hotel_info").Range
("Report_Date").Value, "mm/dd/yyyy")

Set email = Worksheets("Hotel_info").Range("emaillist")

' cwkb = ActiveWorkbook
With Worksheets("Report")
For r = 1 To email.Rows.Count
b = .Range("Titles").Address & "," & .Range
("Summary_lbr").Address

For y = 1 To email.Columns.Count
If Trim(email.Cells(r, y + 1).Text) < ""
Then
b = b & "," & .Range(email.Cells(r, y
+ 1).Text).Address
End If
Next
.Range(b).Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValue
Selection.PasteSpecial Paste:=xlFormats
Next
End With
' .SendMail "

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
Cut, Copy, Paste, PasteSpecial grayed out. news.microsoft.com[_6_] Excel Discussion (Misc queries) 9 October 19th 17 08:45 PM
Copy/pasteSpecial transpose, does not work. Luke M Excel Discussion (Misc queries) 0 September 14th 09 08:58 PM
Copy Chart and PasteSpecial PCLIVE Charts and Charting in Excel 2 October 26th 06 03:01 PM
Copy PasteSpecial not working Richard Buttrey Excel Worksheet Functions 9 August 11th 06 04:40 PM
Automate Copy / PasteSpecial carl Excel Worksheet Functions 1 March 29th 06 07:07 PM


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