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 CountWordsOccurrence() As Integer | |
Application.ScreenUpdating = False | |
Dim sWords As String | |
Dim iCount As Integer | |
'The word which is being counted | |
sWords = "word" | |
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
Protected Sub FormToXML (ByVal sender As Object, ByVal e As System.EventArgs) | |
// Create the XML document object with specified parametres | |
Dim XMLDoc As XDocument | |
XMLDoc = New XDocument( | |
New XDeclaration("1.0", "utf-8", "yes"), | |
New XElement("user", | |
New XElement("details", | |
New XElement("firstname", Firstname.Text), |
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 CreateHTMLMsg() | |
Dim sLocation As String | |
'Change this to the location of your HTML file | |
sLocation = "C:\HTML_Template.html" | |
Set objMsg = Application.CreateItem(olMailItem) | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set ts = fso.OpenTextFile(sLocation, 1) |
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
'Note: needs to be attached to a worksheet | |
Private Sub Worksheet_Change(ByVal Target As Range) | |
'Specifies the target column to pay attention to on worksheet change | |
If (Target.Column = 2) Then | |
'Conditional statement based on cell value | |
Select Case Target.Value | |
Case "red" |
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
'Global Error Varibles | |
Public bDisplayError As Boolean | |
Public sProcName, sDetails As String | |
Public iErrorCount As Integer | |
Public Function bCentralErrorHandler(ByVal sModule$, ByVal sSub$, ByVal sDetails$) As Boolean | |
'Make sure there is no errors in the Error Handling system | |
On Error Resume Next |
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 ListFilesInDirectory() | |
Dim fsFile, sFilename, sPath As String | |
Dim i As Integer | |
i = 2 | |
'Set file attributes | |
sPath = "C:\" | |
sFilename = "*.pdf" |
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
'Global Error Varibles | |
Public bDisplayError As Boolean | |
Public sProcName, sDetails As String | |
Public iErrorCount As Integer | |
Public Function bCentralErrorHandler(ByVal sModule$, ByVal sSub$, ByVal sDetails$) As Boolean | |
'Make sure there is no errors in the Error Handling system | |
On Error Resume Next |
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
'RefreshODBCLinks() | |
'Refreshes the ODBC links to ensure the latest data is being pulled through and is correct | |
Function RefreshODBCLinks() As Boolean | |
Dim sConnStr As String | |
sConnStr = "ODBC;" _ | |
& "DATABASE={Database Name e.g., theDatabase};" _ | |
& "DSN={ODBC Connection Name e.g., theDB};" _ | |
& "LANGUAGE={Lanauge of Database e.g., British};" _ | |
& "DRIVER={SQL Version e.g., SQL Server Native Client 10.0};" _ |
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 WorksheetExists(wsName As String) As Boolean | |
Dim ws As Worksheet | |
Dim found As Boolean | |
found = False | |
wsName = UCase(wsName) | |
For Each ws In ThisWorkbook.Sheets | |
If UCase(ws.Name) = wsName 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
/* Tested with jquery-1.7.2.min.js */ | |
$(window).load(function () { | |
"use strict"; | |
/* Cycles XML file on successful load via ajax and parses contents into HTML */ | |
function parseXML(xml) { | |
/* Variable declaration */ | |
var outHTML = "", employee, sId, sFirstname, sSurname, sAddress; |
OlderNewer