View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Iván[_2_] Iván[_2_] is offline
external usenet poster
 
Posts: 7
Default A Macro for copy with selection.. (please help me)

Jordan, thanks...., this solution is ok. in normal ranges, but I forget
to write that "W" lines are rows from a subtotal process.... In this case
the formula don't work.
What do you think, this row is not real?
Thanks, Ivan

"jordanctc" wrote:


Sub SpecialCopy()
Sheets("Sheet2").Select
Range("A1").Select
Sheets("Sheet1").Select
Range("B1").Select

Do Until ActiveCell = ""
If ActiveCell.Offset(0, -1).Value = "W" Then
ActiveCell.EntireRow.Copy
Sheets("Sheet2").Select
ActiveCell.PasteSpecial
ActiveCell.Offset(1, 0).Select
Sheets("Sheet1").Select
End If
ActiveCell.Offset(1, 0).Select
Loop
End Sub

This should work,
Jordan


--
jordanctc
------------------------------------------------------------------------
jordanctc's Profile: http://www.excelforum.com/member.php...fo&userid=6761
View this thread: http://www.excelforum.com/showthread...hreadid=278331