W
Walter
Here is my coding and when it goes through the loop it makes it through the
entire list of numbers but always misses the last zero which is what I am
trying to delete. Any ideas as to why this is happening? The msgbox is in
there just so I could see what was going on in my code.
Sub CopyTransferData()
'
' CopyTransferData Macro
' Copy totals and eliminate zeros, move to Data tab.
'
Dim rngCurrent As Range
Dim rngCell As Range
Dim result As Integer
Dim shtRorkERP As Worksheet
Set shtRorkERP = Application.ActiveWorkbook.Worksheets("Rork_ERP")
'
'
Range("FirstIteration").Select
Selection.Copy
Range("C1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Set rngCurrent = shtRorkERP.Range("C1").CurrentRegion
Set rngCurrent = rngCurrent.Offset(rowoffset:=0, columnoffset:=1)
Set rngCurrent = rngCurrent.Resize(columnsize:=1)
For Each rngCell In rngCurrent
result = rngCell.Value
If rngCell.Value = 0 Then
rngCell.EntireRow.Select
rngCell.EntireRow.Delete
End If
MsgBox result
Next rngCell
End Sub
entire list of numbers but always misses the last zero which is what I am
trying to delete. Any ideas as to why this is happening? The msgbox is in
there just so I could see what was going on in my code.
Sub CopyTransferData()
'
' CopyTransferData Macro
' Copy totals and eliminate zeros, move to Data tab.
'
Dim rngCurrent As Range
Dim rngCell As Range
Dim result As Integer
Dim shtRorkERP As Worksheet
Set shtRorkERP = Application.ActiveWorkbook.Worksheets("Rork_ERP")
'
'
Range("FirstIteration").Select
Selection.Copy
Range("C1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Set rngCurrent = shtRorkERP.Range("C1").CurrentRegion
Set rngCurrent = rngCurrent.Offset(rowoffset:=0, columnoffset:=1)
Set rngCurrent = rngCurrent.Resize(columnsize:=1)
For Each rngCell In rngCurrent
result = rngCell.Value
If rngCell.Value = 0 Then
rngCell.EntireRow.Select
rngCell.EntireRow.Delete
End If
MsgBox result
Next rngCell
End Sub