selecting ranges in excel using VBA
Posted by David Schlessinger on January 16, 2002 5:27 PM
This is driving me absolutely crazy. I can't write VB that will select a range of cells using the cells property. I even copied the code out of the help menu and I still get Run Time Error '1004', Application Defined or Object Defined error. The code I copied is this:
Worksheets("Macro").Range(Cells(1, 1), Cells(5, 3)).Font.Italic = True
Selecting ranges with just the range property (range("a1:a4") works, but I my ranges need to include integer variables that will change. What is going on here? Is there a different way to select variable ranges?
Dave