PC Review


Reply
Thread Tools Rate Thread

Copy and paste only values

 
 
Jennifer
Guest
Posts: n/a
 
      1st Dec 2007
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
 
Reply With Quote
 
 
 
 
Nigel
Guest
Posts: n/a
 
      1st Dec 2007
ws.Cells(iRow, 1).PasteSpecial Paste:=xlPasteValues

--

Regards,
Nigel
(E-Mail Removed)



"Jennifer" <(E-Mail Removed)> wrote in message
news:B2B0A625-B80F-4C9A-925E-(E-Mail Removed)...
> 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


 
Reply With Quote
 
Greg Wilson
Guest
Posts: n/a
 
      1st Dec 2007
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy / paste as values KRK Microsoft Excel New Users 1 21st Mar 2010 12:49 PM
paste values without copy-paste values Rikkart Microsoft Excel Programming 1 15th Mar 2010 03:01 PM
Find matching values, copy/paste values as well as values in ColA ryguy7272 Microsoft Excel Programming 2 28th Sep 2009 06:20 AM
Copy/Paste how to avoid the copy of formula cells w/o calc values =?Utf-8?B?RGVubmlz?= Microsoft Excel Misc 10 2nd Mar 2006 10:47 PM
How do i compare values from two sheet and copy & paste if values match? =?Utf-8?B?cm96Yg==?= Microsoft Excel Programming 0 5th Mar 2004 12:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:14 AM.