Forum Discussion
Angie Swirski
Jul 02, 2018Copper Contributor
Turning Colums on and off to comare
Hello I have been scouring all over to figure this out - I believe Excel can do it but just not sure how. I've tried a few things and nothing has worked. Following is a link to exactly I'd like to c...
Matt Mickle
Jul 03, 2018Bronze Contributor
Can't get your link to work. However if you want to be able to select a few cells using Ctrl and make only their rows or columns visible and hide all of the other data you could use something like this (See attached .xlsm file for reference) Please note I have attached the example for columns and rows:
Sub CompareCol()
Dim LastCol As Long
Dim Rng As Range
Dim cll As Range
LastCol = Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Column
Set Rng = Selection
Range(Columns(3), Columns(LastCol)).EntireColumn.Hidden = True
For Each cll In Rng
cll.EntireColumn.Hidden = False
Next
End Sub
Sub ReverseCompareCol()
Dim LastCol As Long
LastCol = Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Column
Range(Columns(3), Columns(LastCol)).EntireColumn.Hidden = False
End Sub
Sub Compare()
Dim LastRow As Long
Dim Rng As Range
Dim cll As Range
LastRow = Cells.Find(What:="*", _
After:=Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
Set Rng = Selection
Rows("2:" & LastRow).EntireRow.Hidden = True
For Each cll In Rng
cll.EntireRow.Hidden = False
Next
End Sub
Sub ReverseCompare()
Dim LastRow As Long
LastRow = Cells.Find(What:="*", _
After:=Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
Rows("2:" & LastRow).EntireRow.Hidden = False
End Sub
Angie Swirski
Jul 03, 2018Copper Contributor
Thanks! I’ll play around with this.
And it looks like the link works if you copy and paste it into your browser. Not sure why that is....
And it looks like the link works if you copy and paste it into your browser. Not sure why that is....
- SergeiBaklanJul 03, 2018Diamond Contributor
Angie, I could be wrong but it looks like trimble.com uses outdated TSL security settings which not every browser supports now.