Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 385
Default Copy and paste only values

How do i write in a paste special code for only the values? Thank you my dear
gurus.

Sub Post()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Database")
' find first empty row in database
'iRow = ws.Cells(Rows.Count, 1) .End(xlUp).Offset(1, 0).Row
iRow = ws.Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).Row
Worksheets("Filter").Range("FilterDatabase").Copy ws.Cells(iRow, 1)
end sub
--
Thank you,

Jennifer
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default Copy and paste only values

Commented out is what you were looking for. I prefer to just specify that the
target range value equals the source range value instead. Also note that I
just add 1 to the result of End(xlUp) instead of using Offset. A tad simpler.


Sub Post()
Dim iRow As Long
Dim ws As Worksheet

Set ws = Worksheets("Database")
iRow = ws.Cells(Rows.Count, 2).End(xlUp).Row + 1
ws.Cells(iRow, 1).Value = _
Worksheets("Filter").Range("FilterDatabase").Value
'Worksheets("Filter").Range("FilterDatabase").Copy
'ws.Cells(iRow, 1).PasteSpecial xlPasteValues
Set ws = Nothing: Set ws2 = Nothing
End Sub

Greg
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 / paste as values KRK New Users to Excel 1 March 21st 10 12:49 PM
Copy and paste up to values in last row Scott Excel Discussion (Misc queries) 2 September 23rd 09 10:23 PM
Copy/Paste Values Only Dan R. Excel Programming 5 February 1st 07 11:07 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
How do i compare values from two sheet and copy & paste if values match? rozb Excel Programming 0 March 5th 04 12:06 AM


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