Skip to content

Instantly share code, notes, and snippets.

@superlucky8848
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save superlucky8848/ee60d632fb3cb0aa21d4 to your computer and use it in GitHub Desktop.
Save superlucky8848/ee60d632fb3cb0aa21d4 to your computer and use it in GitHub Desktop.
Easy to use VBA Recipies for MS Office
'[Word] Convert auto generated number to plain text.
ActiveDocument.Content.ListFormat.ConvertNumbersToText
'[Excel] Clear all hyperlinks in current sheet (Useful when copy some linked sheet from web)
ActiveWorkbook.ActiveSheet.HyperLinks.Delete
'[Excel] Safest way get totol rows or cols count for specific table (http://stackoverflow.com/questions/6301665/how-to-count-the-number-of-rows-in-excel-with-data)
rowCnt = targetSheet.Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row
colCnt = targetSheet.Cells.Find("*", [A1], , , xlByColumns, xlPrevious).Column
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment