Jon's Programming Blog

.NET and Modeless Forms

When I was doing some programming in VB.NET (for the Time Stamp program), I tried putting a modeless form in Excel. It came up as a new window in the task bar but then wouldn’t actually show on the screen. When I did a modal form it would show on the screen but also in the task bar. .NET let’s you choose the parent window of your form. I found some code on StackOverflow in C# that gives you the proper owner window in IWin32Window form.

Range Address from Number to Letter

Sometimes, before I realize it (and, I’m sure, others too) I do a bunch of work, that turns out that I didn’t need to do before. The RangeAddress function that I created is a perfect example of this. This function goes from a column number to a letter and returns the whole string range address. I started off with someones else’s code. I then made it work for me. Their code only worked for Excel 2003 and below.

Find Last Cell

Finding the last cell is a common thing people look for when they are coding in VBA. I made a function that does this automatically for me when I am looking for the last cell. In conjunction with the RRange function this simplifies the programming life for VBA significantly. Heres some example code on how to use the function FindEnd. Sub FindEndExamples() Dim l As Long 'Find last row in column 2 on current worksheet l = FindEnd(2) Debug.

Get Range from Row & Column Numbers

Before I created a quite elaborate code to get the column letter from the column numbers. It turns out that it was much easier than I had thought before. So in the code below I’ve simplified it considerably by using the Cells method. In the function below I use a function called FindEnd. 'RRAnge ' -------------------------------------------------------------- 'Comments: This Function returns the desired range. ' 'Arguments: lRow First cell row number. ' lCol First cell column number.

Coming Soon...

I am currently working on a time card that will allow the user to track their time in Excel. This will allow the user to choose multiple projects at once and produce charts as a great visual to see how you are working. After that I will work on my advanced find in VB.NET. The long term project is the spreadsheet budget in Excel. This project is expected for first release in mid 2012.

Import Data from Excel to VBA

I’ve always wanted a function that can get me data from excel in a format that will always be the same. Sometimes I get the data and I expect a 2D variant array but instead get a string or double value. So I created a function to make it easy for myself, getting the same format that I expect. 'ImportExcelData ' -------------------------------------------------------------- 'Comments: This Function imports excel data in different formats (1D, 2D, or String).

Welcome

I decided that using Drupal was more work than I wanted to put into my website, so here’s to WordPress! Hopefully I won’t regret it. Here’s my previous entry for this post: Welcome to SpreadsheetBudget.com. This is my blog that will demonstrate ideas and learning material as I create a budget spreadsheet using Excel. Once I finish creating the software, or at least get closer, I will begin to publish how to articles on how to use the software.

About

Personal Father of four who enjoys, backpacking, reading, and programming. Work in a Nutshell I enjoy functional programming and am currently doing mostly F# with ASP.NET WebAPI (RESTful API), with SQL Server and also some ASP.NET MVC and front end programming (JavaScript/HTML/CSS). I was doing node.js with MongoDB but found F# to a great language to work with in a .NET shop. So I ported it back to .NET platform.

8