Hi ya'll,
I have a macro that I am using to filer a spreadsheet to only show rows and columns that have numbers in them. I would like to tweak this somewhat to allow me to show/hide different columns (or run the 'alternate' show/hide column macro first to get the right columns available and then run my existing macro to filer remaining rows and columns?).
I would like a macro to do this, perhaps with a pop up window asking which columns to show/hide (ie. A:C, L:N, P) - something like that - and the reason why I want a macro for it, as opposed to doing it manually is that other users with only very basic skills will be using the sheets to pull reports and only want to see certain columns per report....if anyone has any better ideas, I'm all for that too...TIA, workbook attached.
Sub test()
Dim frange As Range, numb_in As Range
On Error Resume Next
Set frange = Application.InputBox(Prompt:="Range to filter selection - Type 'C4:AH120'", Title:="Select your range to filter", Type:=8)
If frange Is Nothing Then
Exit Sub
Else
Application.ScreenUpdating = 0
frange.Replace 0, "", xlWhole
Set numb_in = frange.SpecialCells(xlCellTypeConstants)
With frange.SpecialCells(xlCellTypeBlanks)
.EntireRow.Hidden = True
.EntireColumn.Hidden = True
End With
With numb_in
.EntireRow.Hidden = False
.EntireColumn.Hidden = False
End With
frange.Replace "", 0, xlWhole
Application.ScreenUpdating = 1
End If
End Sub
Bookmarks