This file contains hidden or 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
' Code based on snippet from John Walkenbach | |
Function FileExists(fileName) As Boolean | |
FileExists = Dir(fileName) <> "" | |
End Function | |
Function PathExists(pathName) As Boolean | |
' Returns TRUE if the path exists | |
On Error Resume Next | |
PathExists = (GetAttr(pathName) And vbDirectory) = vbDirectory |
This file contains hidden or 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 ColumnLetter(colNum As Long) As String | |
Dim vArr | |
vArr = Split(Cells(1, colNum).Address(True, False), "$") | |
ColumnLetter = vArr(0) | |
End Function |
This file contains hidden or 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
select OBJECT_NAME(triggers.parent_id) as [object_name], | |
triggers.name, | |
triggers.parent_class_desc, | |
triggers.type_desc, | |
triggers.is_disabled, | |
triggers.is_instead_of_trigger, | |
OBJECT_DEFINITION(triggers.object_id) | |
as trigger_definition | |
from sys.triggers |
This file contains hidden or 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
/* apply a natural box layout model to all elements */ | |
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } |
This file contains hidden or 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 AppendTimeStampToCurrentWorkbook() | |
Dim myName As String | |
Dim newName As String | |
Dim last_dot As Long | |
myName = ActiveWorkbook.fullName | |
' InStrRev finds last occurrence of a string in another | |
last_dot = InStrRev(myName, ".") | |
newName = Left$(myName, last_dot - 1) & " - " & Format$(Now, "MM-DD-YYYY HH.MM AM/PM") & Mid$(myName, last_dot) |
This file contains hidden or 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
-- Source: http://stackoverflow.com/questions/18932/how-can-i-remove-duplicate-rows | |
DELETE MyTable | |
FROM MyTable | |
LEFT OUTER JOIN ( | |
SELECT MIN(RowId) as RowId, Col1, Col2, Col3 | |
FROM MyTable | |
GROUP BY Col1, Col2, Col3 | |
) as KeepRows ON | |
MyTable.RowId = KeepRows.RowId |
This file contains hidden or 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
Source for starting point: http://css-tricks.com/abbrs-for-web-nerd-acronymns/ | |
See comments at bottom of hyperlinked post for links to WordPress plugins and other good ideas | |
<abbr title="Customer Relationship Management">CRM</abbr> | |
<abbr title="Content Management System">CMS</abbr> | |
<abbr title="Structured Query Language">SQL</abbr> | |
<abbr title="International Organization for Standards">ISO</abbr> | |
<abbr title="PHP: Hypertext Preprocessor">PHP</abbr> | |
<abbr title="HyperText Markup Language">HTML</abbr> | |
<abbr title="eXtensible HyperText Markup Language">XHTML</abbr> |
This file contains hidden or 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
' I need to do this frequently and like to be able to easily modify the colors I'm using for the banding. | |
' The following sub makes it very easy: | |
Sub GreenBarMe(rng As range, firstColor As Long, secondColor As Long, Optional borderColor As Long) | |
On Error GoTo AlternateGreenBarMe | |
Application.ScreenUpdating = False | |
rng.Interior.ColorIndex = xlNone |
This file contains hidden or 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
/* | |
* Sort nulls in your result set. | |
*/ | |
SELECT * FROM myTable | |
WHERE ... | |
ORDER BY CASE WHEN myCol IS NULL THEN 1 ELSE 0 END, myCol; |