Thursday, April 17, 2014
Sort Columns of the Table using Word VBA
Sort Word Table columns using Word VBA
The following function uses Selection.Sort, you can try alternative methods if selection is not possible / permissible
Function SortTable()
ActiveDocument.Tables(1).Select()
Selection.Sort(ExcludeHeader:=True, FieldNumber:="Column 1", SortFieldType _
:=wdSortFieldAlphanumeric, SortOrder:=wdSortOrderAscending, FieldNumber2 _
:="", SortFieldType2:=wdSortFieldAlphanumeric, SortOrder2:= _
wdSortOrderAscending, FieldNumber3:="", SortFieldType3:= _
wdSortFieldAlphanumeric, SortOrder3:=wdSortOrderAscending, Separator:= _
wdSortSeparateByTabs, SortColumn:=False, CaseSensitive:=False, LanguageID _
:=wdEnglishUS)
Selection.MoveRight(Unit:=wdCharacter, Count:=1)
End Function
The above uses as three column table. Please customize it for your use
See also:
How to use .Net Array.Sort Function in VBA
Case in-sensitive comparison
Tuesday, April 15, 2014
Constants fixed length strings arrays user defined types and Declare statements not allowed as Public members of object modules
Declare Function apiFindWindow Lib "User32" Alias "FindWindowA" _
(ByVal lpclassname As Any, ByVal lpCaption As Any) As Long
DLL procedures declared in standard modules are public by default and can
be called from anywhere in your application. DLL procedures declared in any
other type of module are private to that module, and you must identify them
as such by preceding the declaration with the Private keyword. Hence
Private Declare Function apiFindWindow Lib "User32" Alias "FindWindowA" _
(ByVal lpclassname As Any, ByVal lpCaption As Any) As Long
Should solve the problem
Monday, April 14, 2014
Maximum Limit of Rows Columns etc in Excel
If you have worked on a large set of data from a non-Excel data source, for example, MS ACCESS, there are chances that you would have stored that in multiple sheets.
This riducules the data management. Now in Excel 2007 and above you have a big Excel workbook with 16384 columns and 10,48,576 rows
Following table gives you how big Excel has grown :)
Excel 2003 | Excel 2007 and above | |
Maximum No of Rows | 65,536 | 10,48,576 |
Maximum No of Columns | 256 | 16,384 |
Friday, April 11, 2014
How to Measure the Rank of a Website
The ranking of a website depends on several factors. It depends on Google Page Rank (known as PR), Alexa Traffic Rank, Complete Rank and so many. And to check the ranking status, there are thousands of extension available for internet browsers.
- First, make sure you are using Google Chrome or Firefox.
- If you are a chrome user then click here. And Firefox users can use this link.
- Chrome users will get several toolbars with Web Rank SEO. You can choose either the first one or any other toolbar as you like and then hit on Add to Chrome. And Firefox users should click on Add to Firefox button.
- Then click on install. Firefox should be restarted. But chrome doesnt need to be restarted.
- Now you are almost done. Chrome users must see this like an icon at the upper right corner. And Firefox users will get it like a horizontal bar.