Thread: [Solved] Need Help with Current Macro
View Single Post
 
Old 10-27-2018, 10:19 AM
p45cal's Avatar
p45cal p45cal is offline Windows 10 Office 2016
Expert
 
Join Date: Apr 2014
Posts: 956
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

untested:
Code:
Sub test()
Dim Cell As Range
Dim ws As Worksheet
AcctsToMakeNegative = Array("Circulation-AAFES/NEX-Returns", "Circulation-AAFES/NEX-Returns(Sun)", "Circulation-DECA-Returns(M-Sat)", "Circulation-DECA-Returns (Sun)", "Circulation-All Other Single-Returns", "Circulation-All Other Single-Returns (Sun)", "Circulation-Vending Machines-Pilferage", "Circulation-Vending Machines-Returns (Sun)", "Circulation-Vending Machines-Pilferage (Sun)")
For Each ws In Worksheets(Array("130R", "135R", "140R"))
  For Each cll In ws.Range("B4:B45").Cells
    If Not IsError(Application.Match(cll.Value, AcctsToMakeNegative, 0)) Then
      For Each Cell In cll.Offset(, 3).Resize(, 12).Cells
        If Cell.Value > 0 Then Cell.Value = Cell.Value * -1
      Next Cell
    End If
  Next cll
Next ws
End Sub
Reply With Quote