View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Lars-Åke Aspelin[_2_] Lars-Åke Aspelin[_2_] is offline
external usenet poster
 
Posts: 913
Default Find Copy Paste Special

On Sun, 10 Jan 2010 06:55:17 -0800 (PST), Len
wrote:

Hi,

The following codes work but does not copy paste special value ( ie
copy value without formula )
Several attempts to modify it but it fails

Extract of codes : -

With Worksheets("BS Grp")
iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 To iLastRow
If .Cells(i, "A").Value = "10A" Then
iNextRow = iNextRow + 1
.Rows(i).Copy Worksheets("Sheet3").Cells(iNextRow,
"A").PasteSpecial xlPasteValues
End If
Next i
End With
Sheets("Sheet3").Columns.AutoFit

Any help would be appreciated and thanks
I'm excel vba beginner

Regards
Len



The code seems to work if you just make a new line after the Copy.
Like this:

..Rows(i).Copy
Worksheets("Sheet3").Cells(iNextRow,"A").PasteSpec ial xlPasteValues

Hope this helps / Lars-Åke