Thread: [Solved] Need Help with Current Macro
View Single Post
 
Old 10-27-2018, 06:02 AM
rsrasc rsrasc is offline Windows 10 Office 2013
Competent Performer
 
Join Date: Mar 2014
Location: Germany
Posts: 148
rsrasc is on a distinguished road
Default

Thank you Logit for your reply but it did not work.

Let me see if can get a better explanation.

The code given to me in the below code will convert all numbers from positive to negative for any number in the range E4 through P45.


Code:
Sub test()
    Dim Cell As Range
    Dim ws As Worksheet
    For Each ws In Worksheets(Array("130R", "135R", "140R"))
        For Each Cell In ws.Range("E4:P45")
            If Cell.Value > 0 Then
                Cell.Value = Cell.Value * -1
            End If
        Next Cell
    Next ws
End Sub
Since I realized that some of the numbers in the range E4:P45 cannot be converted to negative numbers, my question was if the original macro given to me can be modified.
This is now where a new macro or a modified macro is needed.

New requirement:

The modified macro will still need the following code:
Code:
For Each ws In Worksheets(Array("130R", "135R", "140R"))
Now, under these three (3) sheets, "130R", "135", and "140R", in Column B, I have the following information or accounts with their corresponding values from Column E to Column P:

Local Advertising-Full Run
General Advertising-Full Run
Advertising-Insert-Local-Full Run
Advertising-Classified-Display
Advertising-Classified-Liners
Advertising-Special Supplements
Circulation-AAFES/NEX-Gross Sales
Circulation-AAFES/NEX-Returns
Circulation-AAFES/NEX-Gross Sales (Sun)
Circulation-AAFES/NEX-Returns(Sun)
Circulation-DECA-Gross Sales(M-Sat)
Circulation-DECA-Returns(M-Sat)
Circulation-DECA-Gross Sales(Sun)
Circulation-DECA-Returns (Sun)
Circulation-Home Delivery-Gross Sales
Circulation-Home Delivery-Gross Sales (Sun)
Circulation-All Other Single-Gross Sales
Circulation-All Other Single-Returns
Circulation-All Other Single-Gross Sales (Sun)
Circulation-All Other Single-Returns (Sun)
Circulation-Vending Machines-Gross Sales
Foreign Currency Conversion Gains
Circulation-Vending Machines-Pilferage
Circulation-Vending Machines-Gross Sales (Sun)
Circulation-Vending Machines-Returns (Sun)
Circulation-Vending Machines-Pilferage (Sun)
Circulation-Exercises/Maneuvers-Gross Sales
Circulation-Exercises/Maneuvers-Gross Sales (Sun)
Circulation-Mail Subscriptions-Gross Sales
Circulation-Mail Subscriptions-Gross Sales (Sun)
Circulation-Direct Drops-Gross Sales
Circulation-Direct Drops-Gross Sales (Sun)
Circulation-Bulk Sales-(Daily)
Circulation-Bulk Sales-(Sunday)
Other Printing Revenue
Other Printing Services-Quick Print
Foreign Currency Conversion Gains
Other Publications Sales-Other Publ Delivery
Advertising-Internet Revenue
Other Revenue


Out of the above listing or information in Column B, I would like the macro to only convert the following accounts from positive to negative numbers.


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)

Therefore, since these are the only accounts that needs to be converted from positive numbers to negative numbers, then my question is if this is possible.

I hope this clarify what is needed.

Thank you all for your assistance and cooperation.

Regards,
rsrasc
Reply With Quote