Hello! I'm a newish user having some trouble with bit of code. I need to copy and paste several selections from one part of a sheet to another part of the same sheet and loop that code across 100 other sheets. This loop needs to exclude a list of sheets: NonPropSheets. NonPropSheets is a named array: Dashboard!$W$13:$W$103. W13:W24 are tab names that need to be excluded from the loop. W25:W103 are blank in case anyone needs to add more sheets to this list.
Here's what I have so far:
Credit: Original Formula is from this thread: Pasting into multiple worksheets VBA
Any help is appreciated.
Here's what I have so far:
VBA Code:
Sub RolloverLastYear()
' Defines variable
Dim ws As Worksheet
' Defines variable nSheets as the sheets you want to ignore
nSheets = Array("NonPropSheets")
' For each sheet in the active workbook
For Each ws In ActiveWorkbook.Worksheets
' If the sheet name is not in the list nSheets then...
If Not IsNumeric(Application.Match(ws.Name, nSheets, 0)) Then
' Copy/Paste Code
Range("B105").Select
Selection.Copy
Range("B104").Select
ActiveSheet.Paste
Range("AH110:AS133").Select
Application.CutCopyMode = False
Selection.Copy
Range("S110").Select
ActiveSheet.Paste
Range("AH135:AS232").Select
Application.CutCopyMode = False
Selection.Copy
Range("S135").Select
ActiveSheet.Paste
Range("O262:Z263").Select
Application.CutCopyMode = False
Selection.Copy
Range("C263").Select
ActiveSheet.Paste
End If
' Check next sheet
Next ws
' Turn off CutCopyMode
Application.CutCopyMode = xlCopy
End Sub
Credit: Original Formula is from this thread: Pasting into multiple worksheets VBA
Any help is appreciated.