Skip to content

Commit

Permalink
Added delete columns, delete rows, and custom sort shortcut macros
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpusher2k committed Feb 19, 2025
1 parent ca10ffe commit e81332d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion ExcelMacros.vba
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
' https://github.com/bitpusher2k
'
' ExcelMacros.vba - By Bitpusher/The Digital Fox
' v1.3 last updated 2024-04-14
' v1.4 last updated 2025-02-12
' Simple Excel macro set.
'
' Usage:
Expand Down Expand Up @@ -371,6 +371,38 @@ Sub UnhideAllRowsColumns()
End Sub


Sub CustomSort()
' CustomSort Macro - Starts the custom sort dialog (save a couple clicks)
Application.CommandBars.ExecuteMso "SortCustomExcel"
End Sub


Sub DeleteHiddenColumns()
' DeleteHiddenColumns Macro - Deletes all hidden columns
Dim Sheet As Worksheet
Dim LastCol As Integer
Set Sheet = ActiveSheet
LastCol = Sheet.UsedRange.Columns(Sheet.UsedRange.Columns.Count).Column
For i = LastCol To 1 Step -1
If Columns(i).Hidden = True Then Columns(i).EntireColumn.Delete
Next
End Sub


Sub DeleteHiddenRows()
' DeleteHiddenRows Macro - Deletes all hidden rows
Dim Sheet As Worksheet
Dim LastRow As Integer
Set Sheet = ActiveSheet
LastRow = Sheet.UsedRange.Rows(Sheet.UsedRange.Rows.Count).Row
For i = LastRow To 1 Step -1
If Rows(i).Hidden = True Then Rows(i).EntireRow.Delete
Next
End Sub




Public Sub SplitDateAndTimeToNewColumns()
Dim MyDateTime As Date
Dim SelectedColumn As Range
Expand Down
Binary file modified PERSONAL.XLSB
Binary file not shown.
Binary file modified Ribbon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e81332d

Please sign in to comment.