S
Steph
Hello. The code below scans the data in column A, and looks for cells where
the right 4 characters are 4040, 4075, 4045 or 8510. If it does, it changes
the sign of the numbers in that row from colums D thru O.
My question is this: Is there a way to enter 4040, 4075, 4045 and 8510 in
cells within a named range called "switch" as opposed to specifically
indentifying them in the code? Thanks!!
Sub ChangeSign()
Dim i As Long
Dim j As Long
Worksheets("Upload Final").Select
For i = 1 To Range("A65536").End(xlUp).Row 'For each row
If Right(Cells(i, 1), 4) = "4040" Or Right(Cells(i, 1), 4) = "4075"
Or Right(Cells(i, 1), 4) = "4045" Or Right(Cells(i, 1), 4) = "8510" Then
For j = 4 To 15
Cells(i, j) = -Cells(i, j)
Next j
End If
Next i
End Sub
the right 4 characters are 4040, 4075, 4045 or 8510. If it does, it changes
the sign of the numbers in that row from colums D thru O.
My question is this: Is there a way to enter 4040, 4075, 4045 and 8510 in
cells within a named range called "switch" as opposed to specifically
indentifying them in the code? Thanks!!
Sub ChangeSign()
Dim i As Long
Dim j As Long
Worksheets("Upload Final").Select
For i = 1 To Range("A65536").End(xlUp).Row 'For each row
If Right(Cells(i, 1), 4) = "4040" Or Right(Cells(i, 1), 4) = "4075"
Or Right(Cells(i, 1), 4) = "4045" Or Right(Cells(i, 1), 4) = "8510" Then
For j = 4 To 15
Cells(i, j) = -Cells(i, j)
Next j
End If
Next i
End Sub