Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Paste only Values, no Formatting

I am wondering how to change this code to paste only values, no formatting:

Sub newone()
Dim RngCol As Range
Dim i As Range
Dim Dest As Range
Sheets("Sheet1").Select
Set RngCol = Range("A1", Range("A" & Rows.Count).End(xlUp))
With Sheets("Sheet2")
Set Dest = .Range("A1")
End With
For Each i In RngCol
If i.Value = "x" Then
i.EntireRow.Copy Dest
Set Dest = Dest.Offset(1)
End If
Next i
End Sub

I tried .Value and PasteSpecial Paste:=xlValues, but can't seem to get the
combination right. what am I missing?

TIA,
Ryan--

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Paste only Values, no Formatting

Hi,

Like this

Sub newone()
Dim RngCol As Range
Dim i As Range
Dim Dest As Range
Sheets("Sheet1").Select
Set RngCol = Range("A1", Range("A" & Rows.Count).End(xlUp))
With Sheets("Sheet2")
Set Dest = .Range("A1")
End With

For Each i In RngCol
If i.Value = "x" Then
i.EntireRow.Copy
Dest.PasteSpecial xlPasteValues
Set Dest = Dest.Offset(1)
End If
Next i
End Sub

Mike

"ryguy7272" wrote:

I am wondering how to change this code to paste only values, no formatting:

Sub newone()
Dim RngCol As Range
Dim i As Range
Dim Dest As Range
Sheets("Sheet1").Select
Set RngCol = Range("A1", Range("A" & Rows.Count).End(xlUp))
With Sheets("Sheet2")
Set Dest = .Range("A1")
End With
For Each i In RngCol
If i.Value = "x" Then
i.EntireRow.Copy Dest
Set Dest = Dest.Offset(1)
End If
Next i
End Sub

I tried .Value and PasteSpecial Paste:=xlValues, but can't seem to get the
combination right. what am I missing?

TIA,
Ryan--

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Paste only Values, no Formatting

Try

i.EntireRow.Copy
Dest.PasteSpecial Paste:=xlPasteValues
Set Dest = Dest.Offset(1)

If this post helps click Yes
---------------
Jacob Skaria


"ryguy7272" wrote:

I am wondering how to change this code to paste only values, no formatting:

Sub newone()
Dim RngCol As Range
Dim i As Range
Dim Dest As Range
Sheets("Sheet1").Select
Set RngCol = Range("A1", Range("A" & Rows.Count).End(xlUp))
With Sheets("Sheet2")
Set Dest = .Range("A1")
End With
For Each i In RngCol
If i.Value = "x" Then
i.EntireRow.Copy Dest
Set Dest = Dest.Offset(1)
End If
Next i
End Sub

I tried .Value and PasteSpecial Paste:=xlValues, but can't seem to get the
combination right. what am I missing?

TIA,
Ryan--

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Paste only Values, no Formatting

That did it! Thanks to both of you.
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Jacob Skaria" wrote:

Try

i.EntireRow.Copy
Dest.PasteSpecial Paste:=xlPasteValues
Set Dest = Dest.Offset(1)

If this post helps click Yes
---------------
Jacob Skaria


"ryguy7272" wrote:

I am wondering how to change this code to paste only values, no formatting:

Sub newone()
Dim RngCol As Range
Dim i As Range
Dim Dest As Range
Sheets("Sheet1").Select
Set RngCol = Range("A1", Range("A" & Rows.Count).End(xlUp))
With Sheets("Sheet2")
Set Dest = .Range("A1")
End With
For Each i In RngCol
If i.Value = "x" Then
i.EntireRow.Copy Dest
Set Dest = Dest.Offset(1)
End If
Next i
End Sub

I tried .Value and PasteSpecial Paste:=xlValues, but can't seem to get the
combination right. what am I missing?

TIA,
Ryan--

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Paste only Values, no Formatting

Your welcome and thanks for the feedback

"ryguy7272" wrote:

That did it! Thanks to both of you.
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Jacob Skaria" wrote:

Try

i.EntireRow.Copy
Dest.PasteSpecial Paste:=xlPasteValues
Set Dest = Dest.Offset(1)

If this post helps click Yes
---------------
Jacob Skaria


"ryguy7272" wrote:

I am wondering how to change this code to paste only values, no formatting:

Sub newone()
Dim RngCol As Range
Dim i As Range
Dim Dest As Range
Sheets("Sheet1").Select
Set RngCol = Range("A1", Range("A" & Rows.Count).End(xlUp))
With Sheets("Sheet2")
Set Dest = .Range("A1")
End With
For Each i In RngCol
If i.Value = "x" Then
i.EntireRow.Copy Dest
Set Dest = Dest.Offset(1)
End If
Next i
End Sub

I tried .Value and PasteSpecial Paste:=xlValues, but can't seem to get the
combination right. what am I missing?

TIA,
Ryan--

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.

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
Macro copy data based on cell formatting and paste special values Drew Excel Programming 1 October 6th 09 11:50 PM
Find matching values, copy/paste values as well as values in ColA ryguy7272 Excel Programming 2 September 28th 09 06:20 AM
Copy and paste formatting and values only Santa-D Excel Programming 4 July 3rd 08 08:18 AM
Copy and paste values, formatting and formulas Joe M. Excel Discussion (Misc queries) 2 February 29th 08 09:38 PM
Paste Special Values but keep formatting and column widths drdavidge[_8_] Excel Programming 1 July 13th 06 05:55 PM


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