View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
puiuluipui puiuluipui is offline
external usenet poster
 
Posts: 468
Default macro - ignore row

Hi, i need two small changes. I nee the code to copy/paste special only
values, without borders, and after the macro copy from B5:G150 and J5:K150,
to paste in workbook COPY TO starting from B2.
Can this be done?
Thanks!

"Jacob Skaria" a scris:

Try the below

This gets copied to the destination workbook. ColB. Change if required...Try
and feedback

Sub CopyPaste()

Dim lngRow As Long, lngNRow As Long, wb As Workbook

Set wb = Workbooks("Copy To.xls")
Windows("ev com.xls").Activate

For lngRow = 2 To 150
If Not Range("B" & lngRow) Like "zzzz*" Then
lngNRow = lngNRow + 1
Range("B" & lngRow & ":G" & lngRow & ",J" & lngRow & _
":K" & lngRow).Copy wb.ActiveSheet.Range("B" & lngRow)
End If
Next

End Sub

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


"puiuluipui" wrote:

Hi, your code is working, but i need the same thing applied to this code.
I can't make this work.

Sub CopyPaste()
'
' CopyPaste Macro
' Macro recorded 10.09.2009 by J
'

'
Range("B2").Select
Windows("ev com.xls").Activate
Range("B5:G150").Select
ActiveWindow.SmallScroll Down:=-129
Range("B5:G150,J5:K150").Select
Range("J5").Activate
Selection.Copy
Windows("Copy To.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("B2").Select
ActiveWindow.SmallScroll Down:=-18
End Sub

Thanks allot!


"Jacob Skaria" a scris:

Try the below macro which copy the range to Sheet2 ignoring the rows which
start with "zzzz" in Column B.

Sub Macro()
Dim lngRow As Long
For Each cell In Range("B2:J150").Rows
If Not cell.Cells(1).Text Like "zzzz*" Then
lngRow = lngRow + 1
cell.Copy Sheets("Sheet2").Range("A" & lngRow)
End If
Next
End Sub

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


"puiuluipui" wrote:

Hi, i have a macro that copy a range (B2:J150)...and i need the macro to
ignore row that begin with "zzzz". I need macro to copy everything in range,
except the row that begin with "zzzz".
I only need this part of the code.
Can this be done?
Thanks!