![]() |
|
#1
|
|||
|
|||
|
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
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
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 |
SUMIFS across multiple closed workbooks
|
funkyfido | Excel | 6 | 01-14-2016 08:55 AM |
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 |