Basically the code that i am using now is not working. my macro is supposed to take the highlighted area and throw it into another worksheet and at the tail end of that, delete any rows in either that column, or in the highlighted area that contain zero.
So before the macro...
A B C
1
- 0
- 0
- 98
- 0
- 20
- 0
- 0
- 15
- 70
2
After the macro
1
- 98
- 20
- 15
- 70
2
But this is what my macro is doing right now and i'm not sure why...
1
- 0
- 98
- 0
- 20
- 0
- 15
- 70
2
It's as if it only deletes the consecutive zeroes. It should be the right coding, but if anyone has an idea why this could be happening, please let me know.
Also. I don't have an example file ready to be uploaded right now. I am just hoping for a quick fix. If no one can help me by the 27th, I will consider posting an example file, but that would take some time without compromising the information contained in the file.
Thank you in advance to anyone that attempts to help. Honestly, I'm glad i can refer to this community.
This is my code just below...
____________________________________________________________________________________________________________
Sub submission()
'
' submission Macro
'
'
Dim ChkRange As Range
Dim Cell As Range
Application.CutCopyMode = False
Selection.Copy
Sheets("Catalog").Select
Dim NextRow As Range
Set NextRow = Range("A" & Sheets("Catalog").UsedRange.Rows.Count + 1)
NextRow.PasteSpecial Paste:=xlValues, Transpose:=False
Application.CutCopyMode = False
Set NextRow = Nothing
Set ChkRange = Range("B:B")
For Each Cell In ChkRange
If Cell = "0" Then
Cell.EntireRow.Delete
End If
Next
End Sub
Bookmarks