Turn on the Macro recorder and position it so you can see Excel and VB Editor at the same time.
Select cell A1. View the code Excel creates. Range("A1").select Range is collection?? "A1" is the parameter Select is the Method Select various parts of the spreadsheet and notice the code that Excel generates. You'll see something like If you forget how to select things in VBA just record and now you know. It will be common to change the range names to make them more flexible. For example if you want to select A1 through the last item in column B you'd do the following r = FindLastRow(2) Range("A1:B" & r).select FindLastRow is a UDF (User Defined Function) Common Mistakes: (2) - is a parameter of column #2 r - is a variable that gets the result of FindLastRow() function. "A1:B" & r - is a concatenation of the strings "A1:B" and the number stored in the variable r |