Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-27-2018, 06:02 AM
rsrasc rsrasc is offline Need Help with Current Macro Windows 10 Need Help with Current Macro Office 2013
Competent Performer
Need Help with Current Macro
 
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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help with Current Macro Macro to auto-save pdf using text on page + current date hysterical.useless Word VBA 12 02-05-2018 02:17 PM
Need Help with Current Macro macro, data import from the ONLY text file in current folder ue418 Excel Programming 5 10-28-2017 12:52 PM
a macro that can copy data from copy.xls to our current excel macro.xls based on criteria: udhaya Excel Programming 1 11-12-2015 10:12 AM
A macro that moves the current paragraph up or down? New Daddy Word VBA 2 04-13-2014 02:25 PM
Need Help with Current Macro Macro for moving one cell down from current position Johnny thunder Word VBA 3 04-07-2011 04:44 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:50 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft