View Single Post
 
Old 02-16-2019, 05:33 PM
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 Need Array for Multiple Workbooks

Hi all,

A while back I was given the following code here is this forum so I could run it in different sheets.

Now, I need a macro that will use the same array function showing here but this time I would like to have this macro running in multiple workbooks.


Also, within the macro I would like to have a code in there so column ("A:A") can be autofit, and columns ("B:N") can be set up with a column width = 10.




Code:
Option Explicit

Sub test()

'Macro to convert numbers to negative. Macro provided by Jeffrey Brown.
'

    Dim Cell As Range
    Dim ws As Worksheet
    For Each ws In Worksheets(Array("130", "135", "140"))
    'Original post has the following info array:
           '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
Attached Files
File Type: xlsx 130-FY 19-Monthly Budget Variance Report Analysis.xlsx (384.6 KB, 8 views)
Reply With Quote