electricdriver93 said:saved my skin.😁
Don't mention it.
😵😵 Sorry... thanks for saving me there.😁
5 posts shown.
electricdriver93 said:saved my skin.😁
Don't mention it.
electricdriver93 said:just swap out that first condition for this one:
If Cells(b, 1).Value Mod 2 = 0 And Cells(b, 1).Value <> 0 Then
Right, so you just need to update the cell reference arguments
like this:
Sub Macro1()
Dim a, b, c
a = Worksheets(1).Rows(1).Cells.SpecialCells(xlCellTypeConstants).Count
c = 1
For b = 1 To a
If Cells(1, b).Value Mod 2 = 0 And Cells(1, b).Value <> 0 Then
Cells(2, c).Value = Cells(1, b).Value
c = c + 1
End If
Next b
End Sub
electricdriver93 said:this gets the job done:
Sub Macro1()
Dim a, b, c
a = Worksheets(1).Columns(1).Cells.SpecialCells(xlCellTypeConstants).Count
c = 1
For b = 1 To a
If Value mod 2 = 0 Then Cells(b, 1).Value = Cells(b, 1).Value
Cells(c, 2).Value = Cells(b, 1).Value
c = c + 1
End If
Next b
End Sub
electricdriver93 said:this should get the job done:
Sub Macro1()
Dim a, b, c
a = Worksheets(1).Columns(1).Cells.SpecialCells(xlCell TypeConstants).Count
c = 1
For b = 1 To a
If Value mod 2 = 0 Then Cells
Cells(c, 2).Value = Cells(b, 1).Value
c = c + 1
End If
Next b
End Sub