6 Jul 2016

VBA Subroutine to Clear All Filters in Excel-Table

Sub filter_clear()

'****************************************************************************************************************
'author:    kay cichini
'date:      06072016
'purpose:   clear all filters in a preformated excel tabel
'****************************************************************************************************************

Dim SelectedCell As Range
Dim TableName As String
Dim ActiveTable As ListObject

Set SelectedCell = ActiveCell

'Determine if ActiveCell is inside a Table
  On Error GoTo NoTableSelected
    TableName = SelectedCell.ListObject.Name
    Set ActiveTable = ActiveSheet.ListObjects(TableName)

    If ActiveTable.ShowAutoFilter Then
      'MsgBox "AutoFilters are turned on"
      If ActiveTable.AutoFilter.FilterMode Then
        'MsgBox "Filter is actually set"
        ActiveTable.AutoFilter.ShowAllData
      End If
    End If
  On Error GoTo 0

Exit Sub

'Error Handling
NoTableSelected:
  MsgBox "There is no Table currently selected! (You need to activate a cell in the Table to be cleared!)", vbCritical

End Sub

23 Feb 2016

List Files Recursively and Write to File in Windows Shell

cd into the directory to be listed and then do:
dir /a-d /b /s > C:\WINDOWS\Temp\file_list.txt
start notepad C:\WINDOWS\Temp\file_list.txt

25 Jan 2016

HTML Legend for Corine Land Cover Classes

For anyone who might benefit from it, I'll post a HTML legend for CORINE Land Cover (CLC) Classes, which I tailored for HTML labelling of CLC-Rasters embeded in my QGIS via WMS.. Choose HTML, CSS or Result from the JSFiddle menu!