Skip to content

Instantly share code, notes, and snippets.

View stevehenderson's full-sized avatar

Steve Henderson stevehenderson

View GitHub Profile
@stevehenderson
stevehenderson / ConcatenateAll
Last active December 17, 2015 08:39
VBA function to concatenate an entire range
Function ConcatenateAll(rng As Range)
Dim x As String, y As String, cel As Range
With ActiveSheet
For Each cel In rng
y = cel.Value
If y <> "" Then
x = x & cel.Value & ", "
End If
Next
End With
@stevehenderson
stevehenderson / CopySheets
Created May 15, 2013 11:32
VBA Code to Copy and Rename Sheets
'http://www.mrexcel.com/forum/excel-questions/150715-copy-place-rename-worksheet-using-visual-basic-applications.html
Public Sub SheetCopy()
Dim Sh As Worksheet, TemplateSh As Worksheet
Dim ShNum As Integer, HighestNum As Integer
Dim SheetCoreName As String
' INDICATE THE CORE SHEET NAME
SheetCoreName = "Sheet"
' INDICATE THE SOURCE SHEET
@stevehenderson
stevehenderson / new_gist_file.vba
Last active December 17, 2015 09:29
VBA Code to sum Range on a specified given sheetName and the coordinates of upper left and lower range corners.
'SumRangeOnSheet(sheetName, r0, c0, r1, c1 As Integer)
'
'Returns the sum of a range specied by UL point (r0, c0) and LR cell (r1,c0)
'on a worksheet specified by sheetName
'
Public Function SumRangeOnSheet(sheetName As String, r0 As Integer, c0 As Integer, r1 As Integer, c1 As Integer)
Dim aRange As Range
Set aRange = ActiveWorkbook.Sheets(sheetName).Range(ActiveWorkbook.Sheets(sheetName).Cells(r0, c0), ActiveWorkbook.Sheets(sheetName).Cells(lastRow, c0))
@stevehenderson
stevehenderson / gist:5606632
Last active December 17, 2015 11:59
Search Gist
http://www.gistboxapp.com/
@stevehenderson
stevehenderson / gist:5606650
Created May 19, 2013 04:12
Search your gists
user:stevehenderson
@stevehenderson
stevehenderson / new_gist_file
Created May 26, 2013 02:03
Assessment Template Upgrades
COURSE DATA CROSS WALK
-A5-A19 need to be hard coded numbers
ALL
-Links to Master Menu need to point to file
-Eliminate code -- use addin
@stevehenderson
stevehenderson / concatenate.py
Created May 26, 2013 02:35
python program to open all files in a directory and concatenate their contents into a single output file
from glob import iglob
import shutil
import os
import fileinput
PATH = '*.csv'
with open("all_da.txt", 'w') as fout:
for filename in iglob(PATH):
for line in fileinput.input(filename):
fout.write(line)
@stevehenderson
stevehenderson / iosAlert
Created October 1, 2013 02:37
IOS Alert
- (IBAction)showalert:(id)sender {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"What Up"
message:@"Hello There"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles: nil];
[alert setAlertViewStyle:UIAlertViewStylePlainTextInput];
[alert show];
}
@stevehenderson
stevehenderson / synch_casa
Created December 12, 2013 01:15
Batch File to Synch External HDD
REM @echo off
CLS
REM CHANGE THE FOLLOWING FOR EACH SYSTEM
SET LocalPath=E:\Users\henderso\Documents\DSE
SET VBS2DEV=P:\vbs2\customer
Echo What is the external drive letter? (no colon needed)
@stevehenderson
stevehenderson / readParse.R
Created March 21, 2014 15:02
R Code to Access Parse.com
library('RCurl')
library('XML')
library('rjson')
clist<-c('X-Parse-Application-Id' = "abcdefghijklmnopqrstuvwxyz",
'X-Parse-REST-API-Key' = "hgjhfghjergbfnrebghjreghjtghjrebnerb" )
opts = list(httpheader = clist,ssl.verifypeer = FALSE)
#Note the limit is set to 1000 (100 is the default; 1000 is max)
results<-getURL("https://api.parse.com/1/classes/TestObject?limit=1000", .opts = opts)