StillUnderstanding
Board Regular
- Joined
- Jan 30, 2021
- Messages
- 80
- Office Version
- 365
- Platform
- Windows
- MacOS
Hi Everyone,
I wonder if you can help me with the VBA below, I want it to loop through the workbook (Excluding the sheets mentioned) then delete 2 columns (e and F) from what is returned.
My issue is that it's only doing the last sheet.
Would someone be able to help me with this please?
I wonder if you can help me with the VBA below, I want it to loop through the workbook (Excluding the sheets mentioned) then delete 2 columns (e and F) from what is returned.
My issue is that it's only doing the last sheet.
Would someone be able to help me with this please?
VBA Code:
Sub Availability()
Dim ws As Worksheet
Application.ScreenUpdating = False
Sheets("Summary").Activate
Range("A2:g1000").Select
Application.CutCopyMode = False
Selection.ClearFormats
Selection.Clear
For Each ws In Worksheets
If ws.Name <> "Summary" And ws.Name <> "Lookup" And ws.Name <> "Index" Then
ws.Range("b2:g3").Copy
Worksheets("Summary").Cells(Rows.Count, 1).End(xlUp).Offset(1, 1).PasteSpecial (xlPasteValues)
ws.Range("b2:g3").Copy
Worksheets("Summary").Cells(Rows.Count, 1).End(xlUp).Offset(1, 1).PasteSpecial (xlPasteFormats)
End If
Next ws
Sheets("Summary").Activate
Range("e2:f1000").Select
Selection.Delete
End Sub
Last edited by a moderator: