Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
TAB to enter data, it skips one or more cells | Excel Worksheet Functions | |||
Data Validation skips rows | Setting up and Configuration of Excel | |||
code skips blanks in data | Excel Programming | |||
when I enter data in my worksheet, it skips to much lower boxes | Charts and Charting in Excel | |||
constructing a copy-paste loop that skips rows | Excel Programming |