I am given a range which identifies a block of data, including a row of column headings and a column of row headings (please see image).
I want to obtain a range that describes just the numeric data.
I came up with this, but as always, wonder if there is a better way:
Code: Select all
Sub test()
Dim rngData As Range
Set rngData = selection
Dim rngNumeric As Range
Set rngNumeric = Range(rngData.Cells(2, 2), rngData(rngData.Rows.Count, rngData.Columns.Count))
rngNumeric.Select
End Sub