Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-16-2019, 05:33 PM
rsrasc rsrasc is offline Need Array for Multiple Workbooks Windows 10 Need Array for Multiple Workbooks Office 2013
Competent Performer
Need Array for Multiple Workbooks
 
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, 6 views)
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Array for Multiple Workbooks 30 Day Running or Rolling total (Multiple Sheets/Workbooks) HelicopterChick Excel 3 08-23-2016 04:52 AM
Syncing data between two excel workbooks using multiple criteria Merlot Excel 2 05-04-2016 06:41 AM
Need Array for Multiple Workbooks SUMIFS across multiple closed workbooks funkyfido Excel 6 01-14-2016 08:55 AM
Need Array for Multiple Workbooks Vlookup multiple workbooks c123456 Excel 3 03-13-2015 12:59 PM
Link multiple excel workbooks to publisher bandcsaravia Publisher 0 10-24-2011 09:14 AM

Other Forums: Access Forums

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


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