VBAWannabee2
New Member
- Joined
- Feb 23, 2022
- Messages
- 28
- Office Version
- 2010
- Platform
- Windows
Hi All!
I have this code but I can't work it out to loop thru worksheets.
What it does is per sheet in my workbook, it copies the values on Column B to Column C (Only the visible cells because the data on all sheets was subtotaled)
Hope my explanation is clear enough. Please see screenshot also. Thanks for any assistance!
I have this code but I can't work it out to loop thru worksheets.
What it does is per sheet in my workbook, it copies the values on Column B to Column C (Only the visible cells because the data on all sheets was subtotaled)
Hope my explanation is clear enough. Please see screenshot also. Thanks for any assistance!
VBA Code:
Dim ws As Worksheet
Dim rng As Range
For Each ws In ActiveWorkbook.Worksheets
If ws.Visible = True Then
For Each rng In Range(Cells.Find(What:="Total"), Range("B" & Rows.Count).End(xlUp)).SpecialCells(xlVisible).Areas
rng.Offset(, 1).Value = rng.Value
Next rng
End If
Next ws