RGButzArchInc
New Member
- Joined
- Aug 16, 2009
- Messages
- 24
I reworking a spreadsheet in an address book format. I want to check if cell(i,1) and cell(I5) are empty. if empty I want to delete the row. VBA and Macros 2010 shows a sub routine on pages 73 and 74 listed as follows.
LastRow = cells(rows.coutn,1).End(xlUp).roe
for i = 1 to lastRow
if IsEmptyh(cells(1,1)) Then
Cells(i,1).Resize(1,4).Interior.ColorIndex = 1
end if
Next i
I have written the following
Sub F_DeleteEmptyDate_06()
'
' DeleteEmptyDate Macro
' Delete the rows that have an empty date cell and an empty address cell.
' The end of the data is determined by inspection
'
'Last Row is determined by inspection
'Declare Variables
Dim I As Integer
Dim Cell As Range
Dim ws As Worksheet
'Set variables
Set ws = ActiveSheet
Set Cell = Cells.Columns(WScolAddress)
'Executables
For I = 1 To 13074
If IsEmpty(Cells(I, WScolAddress)) And _
IsEmpty(Cells(I, 5)) Then
'ActiveCell.Offset(2, 0).Rows("1:1").EntireRow.Select
ActiveCell.EntireRow.Select
Selection.Delete Shift:=xlUp
'Application.Goto Reference:="DeleteEmptyDate"
End If
Next
End Sub
Where am I going wrong
LastRow = cells(rows.coutn,1).End(xlUp).roe
for i = 1 to lastRow
if IsEmptyh(cells(1,1)) Then
Cells(i,1).Resize(1,4).Interior.ColorIndex = 1
end if
Next i
I have written the following
Sub F_DeleteEmptyDate_06()
'
' DeleteEmptyDate Macro
' Delete the rows that have an empty date cell and an empty address cell.
' The end of the data is determined by inspection
'
'Last Row is determined by inspection
'Declare Variables
Dim I As Integer
Dim Cell As Range
Dim ws As Worksheet
'Set variables
Set ws = ActiveSheet
Set Cell = Cells.Columns(WScolAddress)
'Executables
For I = 1 To 13074
If IsEmpty(Cells(I, WScolAddress)) And _
IsEmpty(Cells(I, 5)) Then
'ActiveCell.Offset(2, 0).Rows("1:1").EntireRow.Select
ActiveCell.EntireRow.Select
Selection.Delete Shift:=xlUp
'Application.Goto Reference:="DeleteEmptyDate"
End If
Next
End Sub
Where am I going wrong