How often does in forums/groups discussion people ask things without researching (i.e. googling about) it first? The answer is surprisingly plenty 😀
Well, if you meet them, you could ask them to visit Let Me Google That For You.
So instead of asking you, they could ask the question to that website. All they REALLY need is just typing the question, and then that website will do the searching for them. And yes, the searching is through Google.
About Hardono
Howdy! I'm Hardono. I am working as a
Software
Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.
Very often, my “customers” asked me to retrieve records from database and pass it to them as an Excel Document. Previously, I need to manually set the width and wrap each of the columns.
I found it tedious and time wasting (the manual formatting, not the user’s request :D)
This macro below will automatically set all columns to auto-fit and wrap those columns that are too wide.
To add macro to your Excel, follow these steps:
- Click Tools -> Macro -> Record New Macro
- Give the Macro a meaningful name and description. The shortcut key is optional. If you want to make the Macro available in any Excel in your PC, store the macro in “Personal Macro Workbook”. Click OK to continue.
- A small floating window will appear. Click the ‘Stop Recording’ button.
- Click Tools -> Macro -> Visual Basic Editor (or press Alt-F11)
- Complete the code as shown below
- Save it. The macro now will be run whenever you press the shortcut key (if you defined it), or you could find the macro through clicking Tools -> Macro -> Macros (or by pressing Alt-F8)
Sub FormatQueryResult()
'
' FormatQueryResult Macro
' To make the Database query result less irritating to the eyes
'
Dim i As Integer 'counter
SendKeys "^a", True 'Send Ctrl-A to select All
'Make the column auto fit
For i = 1 To Selection.Columns.Count
ActiveSheet.Columns(i).AutoFit
Next
'Wrap columns that are too wide
For i = 1 To Selection.Columns.Count
If ActiveSheet.Columns(i).Width >= 250 Then
ActiveSheet.Columns(i).ColumnWidth = 65
ActiveSheet.Columns(i).WrapText = True
End If
Next
End Sub
About Hardono
Howdy! I'm Hardono. I am working as a
Software
Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.
Upon its release, I immediately downloaded and installed Google Chrome. After trying for a while, I found out that Java Applet is not yet supported. It was a big NO-NO since I frequently use DBS’ Internet Banking, which uses secure Java applet.
So today I give Chrome another try (for obvious reason, system reinstall). Apparently now Java plugin is supported by Google Chrome. You could download the JRE (Java Runtime Environment) HERE.
So I installed the beta JRE, restarted Chrome, then curiously visited DBS’ Internet banking site. When the page loaded, I noticed that the JRE icon is now loaded in Windows’ System Tray. But it seems the plugin doesn’t work as shown below

Then I used that old trick, something similar to banging your TV when the picture got blurry. I refreshed the page by pressing F5. Click continue, then Voila! It the login page is now displaying properly.
UPDATE (15 Oct 2008):
I can’t use the transfer functionality. The session was abruptly ended.
About Hardono
Howdy! I'm Hardono. I am working as a
Software
Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.