![]() |
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 |
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 |
All times are GMT +1. The time now is 03:04 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com