Skip to content

Instantly share code, notes, and snippets.

@ricdeez
ricdeez / JoinCells.vb
Created January 17, 2013 07:08
VBA: Join Cells on a Spreadsheet
Public Sub JoinCells()
Dim xls As Excel.Worksheet
Dim cell As Excel.Range
Dim destn_rge As Excel.Range
Dim combined As String
Dim i As Long
i = 0
Set destn_rge = Nothing
@ricdeez
ricdeez / gist:4436412
Created January 2, 2013 17:43
ImageMagick label picture
convert sm_giga-01.jpg -gravity south \
-stroke '#000C' -strokewidth 2 -annotate 0 'g33ky_b1ts' \
-stroke none -fill white -annotate 0 'g33ky_b1ts' \
polsm_giga-01.jpg
@ricdeez
ricdeez / msproject_filter_by_taskname_and_sort.rb
Created December 13, 2012 22:59
MS Project: List of tasks matching a pattern, sorted by one parameter
#!/usr/bin/ruby
%w( win32ole pp date ).each { |dep| require dep }
doc = 'C:\Users\rdapaz\Dropbox\Karara\Schedule\K2 Master Schedule - Delayed FAT Scenario.mpp'
mpp = WIN32OLE.new('MSProject.Application')
mpp.Visible = true
mpp.FileOpen(doc)
tasks = []
mpp.ActiveProject.Tasks.each do |tsk|
@ricdeez
ricdeez / gist:4167844
Created November 29, 2012 09:42
Ruby: Instantiate Word Object
$wd = WIN32OLE.new('Word.Application')
$wd.Visible = true
doc = $wd.Documents.Open(doc_file)
@ricdeez
ricdeez / gist:4167831
Created November 29, 2012 09:36
Ruby: Manipulate MSWord Docs
%w(pp win32ole).each {|dep| require dep}
begin
$app = WIN32OLE.connect('Word.Application')
rescue Exception => e
$app = WIN32OLE.new('Word.Application')
end
$app.Visible = true
class WordConst
@ricdeez
ricdeez / gist:4167823
Created November 29, 2012 09:34
Ruby: Turn pipe delimited data into array of arrays.
new_data = new_data.split(/\n/).collect {|v| v.split(/\|/)}