Skip to content

Instantly share code, notes, and snippets.

View mjdescy's full-sized avatar

Michael Descy mjdescy

View GitHub Profile
@mjdescy
mjdescy / RowHeightAdjustments.mod
Created April 9, 2020 00:20
Adjust Row Height in Excel
Option Explicit
Const DefaultRowHeight As Double = 14.5
Public Sub IncreaseRowHeightByOneLine()
Call SafelyAdjustRowHeightForAllRowsInRange(Range:=Selection, RowHeightAdjustment:=DefaultRowHeight)
End Sub
Public Sub DecreaseRowHeightByOneLine()
Call SafelyAdjustRowHeightForAllRowsInRange(Range:=Selection, RowHeightAdjustment:=-DefaultRowHeight)
@mjdescy
mjdescy / SizeActiveChart.mod
Last active April 9, 2020 14:41
Excel macro for setting the selected chart to a default size
Option Explicit
Const DefaultChartHeightInInches As Double = 4#
Const DefaultChartWidthInInches As Double = 8.3
Public Sub SetActiveChartToStandardSize()
If ActiveChart Is Nothing Then
Exit Sub
End If
@mjdescy
mjdescy / MakeActiveChartOverlapRange.bas
Created April 9, 2020 17:41
Make active Excel chart overlap a range completely
Option Explicit
Public Sub SetActiveChartToCompletelyCoverARange()
Call ResizeAndRepositionChart( _
Chart:=ActiveChart, _
Range:=AskUserToInputARange())
End Sub
Private Sub ResizeAndRepositionChart(ByRef Chart As Excel.Chart, ByRef Range As Excel.Range)
If Chart Is Nothing Then