Team,
I am finally moving from manipulating data in worksheets to working with arrays.
Can someone suggest an alternative to to the BOLD array loop? Is there a way to change AH(a,2) thru Ah(a,8) to zeros without looping?
Code:
Option Explicit
Sub ChangeRows()
Dim AH, a As Long, aa As Long
AH = Cells.Cells(1).CurrentRegion.Resize(, 8)
For a = LBound(AH) To UBound(AH)
If AH(a, 1) = "DEF" Or AH(a, 1) = "GHI" Then
For aa = 2 To 8
AH(a, aa) = 0
Next aa
End If
Next a
Cells.Cells(1).CurrentRegion.Resize(, 8) = AH
End Sub
Thanks in advance.
Have a great day,
Stan
Bookmarks