I defined a range in VBA using the following code
Range("D3").Select
Set x = Range(Selection, Selection.End(xlDown))
For I would like to do now is perform a function for all elements in the range except the first and last item.
So the code looks like this:
Range("D3").Select
Set x = Range(Selection, Selection.End(xlDown))
For Each cell In x
'if not first or last item
'Do something
Next cell
However I can seem to get the first and last item. If I do something like x[1] of x(1) I get an error. Any thoughts on where I go wrong?