Sunday, April 07, 2019

Thank You Charlie Nuttelman : Excel VBA Stuff

So much I didn't know about - man - you don't get to be a trillion $ company with a cash cow unless it has some serious bells and w.

Relative referencing while recording macros - this can make you more productive building a macro to automate a recurring task - check it out!
The Locals window - watch your productivity zoom, already!

The thing that didn't do much for me was the Object Browser - a clear tutorial might help there.. (BTW, you might find his start in Lesson 14 adorable. You'll see how you easily put together something like

Private Sub Workbook_WindowResize(ByVal Wn As Window)
MsgBox ("You resized me!")
End Sub

which is very cute :) )

Other things I must thank the Nutty Professor for :

  1. Exit For, Exit Sub, Exit Do -- sometimes ease trumps elegance
  2. Option Base 1 -- when you want to be a lay person and count starting from 1 :)
  3. ReDim Preserve -- you declare a variable and now, you know how big your array is going to be (or you need to resize it - make it one bigger, and, if you don't say Preserve, you're going to reset all elements to 0... So..
  4. Relative Referencing while recording macros - so cool :)
  5. The Locals Window! What a lifesaver
  6. Declare (Dim) at the Module level, and you can access in all modules
  7. Optional arguments to Functions and Static Variables
  8. All Dim'd variables start out with a value of 0
  9. Debugging : run to cursor : CTRL-F8
  10. If you want your code to automatically enter debug mode upon a certain condition being met : Debug.Assert <condition>
  11. If you're in the VB Editor, ALT-F11 takes you back to the Workbook - you'd think I'd know that one :)
  12. XLAM - Excel Macro Add in - how to Add-in/make a function available
  13. How to run a VBA routine from another file
  14. The Object Browser - like I said the YT tutorial by ExcelVBAHelp is better
  15. You can do .Range of a Range, because a Range is now its own Spreadsheet!
  16. Application.ScreenUpdating = False -- to get stuff to finish faster
  17. Goal Seek, Solver, Bisection Method, Circular Calculation enabling
  18. The power of Dim'ing as Variant - for an array - assign selection without for loops..

No comments: