Liberteric
New Member
- Joined
- Sep 29, 2014
- Messages
- 28
If cell A in row 1 equals 0 I need to run a macro from column E "AddLine" (which shifts cells from e thru end-right, down)
If its not equal to 0 I need to continue to run it.
This is what I have but it only inserts a whole row in row a1 then stops
Sub MyInsertMacro()
Dim myLastRow As Long
Dim myRow As Long
Application.ScreenUpdating = False
' Find last row with data in column A
myLastRow = Cells(Rows.Count, "A").End(xlUp).Row
' Loop through all rows in column A, starting at row 1
For myRow = 1 To myLastRow
' Check to see if value in column A is 0
If Cells(myRow, "A") = 0 Then
' call Addline
End If
Next myRow
If its not equal to 0 I need to continue to run it.
This is what I have but it only inserts a whole row in row a1 then stops
Sub MyInsertMacro()
Dim myLastRow As Long
Dim myRow As Long
Application.ScreenUpdating = False
' Find last row with data in column A
myLastRow = Cells(Rows.Count, "A").End(xlUp).Row
' Loop through all rows in column A, starting at row 1
For myRow = 1 To myLastRow
' Check to see if value in column A is 0
If Cells(myRow, "A") = 0 Then
' call Addline
End If
Next myRow