- Learn all IDE shortcut key combinations
- Get a refactoring tool (ie. Resharper or Refactor! Pro)
- Write shims where possible (more later)
- Learn Regular Expressions!
- Find a scripting language you like and use it
- Find a good text editor (notepad++, editplus, etc...)
- Multiple Clipboards
- Macro Support
- Regular Expressions
- Customizable Shortcuts
- File Templates
- Allows Plug-Ins
- Learn to love and use macro's
- Etc...
He claimed that the little bit of work he did to figure out how to do this has really improved the overall productivity of the whole team. Developers just check-in their source files and their wiki's are updated automatically. Plus, the project leads and product managers were able to check the various wiki's with an accurate reading of what got done at the end of every day. They no longer had to wait til the end of the week and then rely on developers to remember to update their status pages.
I admit that I get caught up in writing shims a lot. I actually wrote one the other day in Excel. My mother-in-law is an accountant and every year, her and her secretary (who is actually her sister; my aunt-in-law if you will) have me print out daily schedule forms for them. I've tried to convince them to use Outlook or something similar to keep track of appointments, but they insist on the paper form...
Anyway, every year I have to create an Excel sheet that starts from the first week in the next year to the week of April 15th (unless April 15th falls on a weekend, in which case do that next week). Each page represents a single week and appointments run from 7am to 7pm in 1/2 hour increments on each page. I dread doing it every year because I always have to rebuild it or use last years file and modify / edit / format it accordingly. Last week I decided to just sit down and write a "shim" to do it instead. Here it is:
Sub CreateScheduleSheet()It works rather well and has already come in handy actually. I printed out the wrong year the first time, so I just came back home, ran the macro with the new year, and viola. It has some assumptions built into it, but it serves a single purpose and has already saved me a small chunk of time. Now I won't dread it when I remember I have to create a paper schedule next year during tax season.
Dim year As Integer
Dim eachDay As Date
Dim columnIndex As Integer
Dim rowIndex As Integer
Dim wereDone As Boolean
Dim thisCell As Object
' get the year
year = CInt(InputBox("What year do you need the sheets for?", _
"Year Entry", Format(Now(), "yyyy")))
' get the first date cell
' since the sheet has to start on a sunday, find
' the first sunday (on or before) the first of the year
eachDay = DateSerial(year, 1, 1)
Do Until Weekday(eachDay) = 1
eachDay = DateAdd("d", -1, eachDay)
Loop
' start at b2 and loop through all columns til we're done
wereDone = False
columnIndex = 2
rowIndex = 2
Do Until wereDone
' get the current cell and increment the column index
' if the date a saturday, skip a column
Set thisCell = Sheet1.Cells(rowIndex, columnIndex)
columnIndex = columnIndex + IIf(Weekday(eachDay) = 7, 2, 1)
' set the date and increment the date
thisCell.Value = Format$(eachDay, "m/d/yyyy")
eachDay = DateAdd("d", 1, eachDay)
' check to see if we're done yet (remember to end on a saturday)
If eachDay >= DateSerial(year, 4, 15) Then
If Weekday(eachDay) = 7 Then
wereDone = True
End If
End If
Loop
End Sub
No comments:
Post a Comment