#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default macro - ignore row

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!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default macro - ignore row

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!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default macro - ignore row

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!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default macro - ignore row

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!

  #5   Report Post  
Posted to microsoft.public.excel.misc
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!



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default macro - ignore row

Try the below 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
lngNRow = 1

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

End Sub

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


"puiuluipui" wrote:

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!

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default macro - ignore row

It's still copy border. And now i have 2 blank columns between the other
columns. And i need the code to copy from row 5 to row 2.
I need the macro to do everything exactly like "my macro" but to ignore
"zzzz" exactly like "your macro".
can this be done?
Thanks!

"Jacob Skaria" a scris:

Try the below 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
lngNRow = 1

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

End Sub

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


"puiuluipui" wrote:

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!

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default macro - ignore row

I have tested that; that should not copy the borders..However I have modified
your macro now..as below..Try and feedback

Sub CopyPaste()
Application.ScreenUpdating = False
Windows("ev com.xls").Activate
Range("B5:G150,J5:K150").Copy
Windows("Copy To.xls").Activate
ActiveSheet.Range("B2").PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Range("B2").Select
For lngRow = 150 To 2 Step -1
If Range("B" & lngRow) Like "zzzz*" Then Rows(lngRow).Delete
Next
Application.ScreenUpdating = True
End Sub

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


"puiuluipui" wrote:

It's still copy border. And now i have 2 blank columns between the other
columns. And i need the code to copy from row 5 to row 2.
I need the macro to do everything exactly like "my macro" but to ignore
"zzzz" exactly like "your macro".
can this be done?
Thanks!

"Jacob Skaria" a scris:

Try the below 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
lngNRow = 1

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

End Sub

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


"puiuluipui" wrote:

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!

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default macro - ignore row

It's working perfect! You are very patient.
Thanks allot!

"Jacob Skaria" wrote:

I have tested that; that should not copy the borders..However I have modified
your macro now..as below..Try and feedback

Sub CopyPaste()
Application.ScreenUpdating = False
Windows("ev com.xls").Activate
Range("B5:G150,J5:K150").Copy
Windows("Copy To.xls").Activate
ActiveSheet.Range("B2").PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Range("B2").Select
For lngRow = 150 To 2 Step -1
If Range("B" & lngRow) Like "zzzz*" Then Rows(lngRow).Delete
Next
Application.ScreenUpdating = True
End Sub

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


"puiuluipui" wrote:

It's still copy border. And now i have 2 blank columns between the other
columns. And i need the code to copy from row 5 to row 2.
I need the macro to do everything exactly like "my macro" but to ignore
"zzzz" exactly like "your macro".
can this be done?
Thanks!

"Jacob Skaria" a scris:

Try the below 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
lngNRow = 1

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

End Sub

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


"puiuluipui" wrote:

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!

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
Ignore macro run time error phil Excel Discussion (Misc queries) 4 March 27th 08 12:11 PM
ignore #N/A in a sum? Todd Excel Worksheet Functions 3 September 5th 06 10:05 PM
IF to ignore #N/A claytorm Excel Discussion (Misc queries) 6 November 21st 05 07:53 PM
please ignore Jordan Excel Worksheet Functions 0 June 17th 05 12:00 AM
Ignore #DIV/0! DLZ217 Excel Worksheet Functions 4 April 26th 05 03:20 AM


All times are GMT +1. The time now is 02:27 AM.

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"