Hello folks,
Can someone help me with VBA for this example?
So, I would like to hide all rows except selected case (sheet "Refresh" - cell A1), in sheets "Summary" and "AAA".
Thank you in advance.
Hello folks,
Can someone help me with VBA for this example?
So, I would like to hide all rows except selected case (sheet "Refresh" - cell A1), in sheets "Summary" and "AAA".
Thank you in advance.
Try:
![]()
Sub foo() Dim ws As Worksheet Dim rng As Range Dim c As Range For Each ws In ThisWorkbook.Worksheets Set c = ws.Columns(2).Find("Section") If Not c Is Nothing Then Set rng = Range(c.Offset(1, 0), ws.Cells(Rows.Count, 2).End(xlUp)) Set c = Nothing For Each c In rng With c.MergeArea .EntireRow.Hidden = Not .Cells(1).Value = Worksheets("Refresh").Range("A1").Value End With Next c End If Next ws End Sub
let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source
If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE
Walking the tightrope between genius and eejit...
Just a comment.
You are making life complicated by merging cells. Most of us avoid them like the plague - they are just too much trouble and cause too many problems. Apart from which any analysis is seriously compromised.
I'd urge you to change your layout and capture data in a normalised 2 dimensional data table. In your case have columns for
Date
Customer
Section
Data
Value
'Sheet Name' i.e. AAA, 000 or whatever this analysis is meant to record
and make each piece of data a record.
In addition to simplifying any analysis you'll open up the whole wonderful world of the Pivot Table functionality
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star iconbelow the post.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks