This script copies all cells from C2:C3 for all sheets in the workbook. I would like for it to ignore all hidden sheets. Also the current script is pasting into the next available row when I am trying to paste into the next available column.
Option Explicit
Sub Sample()
Dim wsInput As Worksheet, wsOutput As Worksheet
Dim rng As Range
Dim LRowO As Long, LRowI As Long
'Set the output sheet
Set wsOutput = ThisWorkbook.Sheets("Master")
For Each wsInput In ThisWorkbook.Worksheets
If wsInput.Name <> wsOutput.Name Then
With wsInput
Set rng = .Range("C2:C3")
rng.Copy
With wsOutput
LRowO = .Range("A" & .Rows.Count).End(xlUp).Row + 1
.Range("A" & LRowO).PasteSpecial xlPasteValues, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End With
End With
End If
Next wsInput
Exit Sub
End Sub