This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysqld --verbose --help | grep -A 1 "Default options" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub NameCellRangesAfterCellContent() | |
Dim columnNumber As Integer | |
columnNumber = 2 | |
For i = 1 To 100 | |
If Sheets("Sheet Name").Range("A" & i).Value <> "" Then | |
ActiveWorkbook.Names.Add Name:=Sheets("Sheet Name").Range("A" & i).Value, RefersToR1C1:="='Sheet Name'!R" & i & "C" & columnNumber | |
End If | |
Next i | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub ChangeHyperlinkedShapesToUseNewSheetNames() | |
Dim ws As Worksheet | |
For Each ws In ActiveWorkbook.Worksheets | |
For Each shp In ws.Shapes | |
If shp.Type = 1 Then | |
On Error Resume Next | |
If shp.Hyperlink.SubAddress = "'Old sheet'!A1" Then | |
shp.Hyperlink.SubAddress = "'New sheet'!A1" | |
End If | |
End If |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function CholeskyDecompose(matrix As Range) | |
Dim A, LTM() As Double, S As Double | |
Dim j As Long, K As Long, i As Long, N As Long, M As Long | |
A = matrix | |
N = matrix.Rows.Count | |
M = matrix.Columns.Count | |
If N <> M Then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub GenerateLinkedTOCFromWorkSheetNames() | |
Dim ProposedTOCWorksheetName As String | |
Dim NewTOCWorksheetName As String | |
Dim CurrentWorksheet As Worksheet | |
Dim Count As Integer | |
ProposedTOCWorksheetName = "TOC" | |
NewTOCWorksheetName = "TOC" | |
RowCounter = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' For example: Call SetColumnWidths("Sheet1", Array(2, 4, 6, 8), 0) would collapse columns B, D, F and H on Sheet1 | |
Sub SetColumnWidths(sheet As String, columnNumbers As Variant, width As Integer) | |
For i = 0 To UBound(columnNumbers) | |
Worksheets(sheet).Cells(1, columnNumbers(i)).EntireColumn.ColumnWidth = width | |
Next i | |
End Sub | |
' Or to hide a contiguous range: | |
Sub HideColumns(sheet As String, leftmostCol As Integer, rightmostCol As Integer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function TRIDIST(random As Double, min As Double, max As Double, mode As Double) | |
If mode < min Or max < mode Then | |
TRIDIST = CVErr(xlErrValue) | |
Else | |
If random <= (mode - min) / (max - min) Then | |
TRIDIST = min + Sqr((max - min) * (mode - min) * random) | |
Else | |
TRIDIST = max - Sqr((max - min) * (max - mode) * (1 - random)) | |
End If | |
End If |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub AddScreenTipsToHyperlinkedShapesUsingShapeText() | |
Dim ws As Worksheet | |
For Each ws In ActiveWorkbook.Worksheets | |
For Each shp In ws.Shapes | |
If shp.Type = 1 Then | |
On Error Resume Next | |
shp.Hyperlink.ScreenTip = shp.OLEFormat.Object.ShapeRange.TextFrame.Characters.Text | |
End If | |
Next shp | |
Next ws |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
With Sheets("Source Data Sheet Name") | |
Set ChartXRange = .Range("A1:A10") | |
Set ChartRange = .Range("B1:B10") | |
End With | |
Sheets("Chart Sheet Name").ChartObjects("Chart Name").Chart.SeriesCollection(1).XValues = ChartXRange | |
Sheets("Chart Sheet Name").ChartObjects("Chart Name").Chart.SeriesCollection(1).Values = ChartRange |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub StripWhiteSpaceFromSelection() | |
Dim SelectedRange As Range | |
Set SelectedRange = Selection | |
For Each Col In SelectedRange.Columns | |
For Each Row In SelectedRange.Rows | |
Cells(Row.Row, Col.Column).Value = Trim(Cells(Row.Row, Col.Column).Value) | |
Next Row | |
Next Col | |
End Sub |