Sub SelectMatrix(intRow As Integer, intCol As Integer)
Dim rng As Range '<----- This is your range variable
Dim ws As Worksheet <---- This is your worksheet
Set ws = Application.ActiveSheet '<---- Set the worksheet to be the current active sheet
Set rng = ws.Range(Cells(1, 1), Cells(intRow, intCol)) '<--- define the range as A1 (1,1) to the user-supplied endpoint
rng.Select '<--- Select the range
Set ws = Nothing '<--- Clear the objects
Set rng = Nothing
End Sub
|