One way. However, selections are seldom desirable. Post all of your code.
Sub findfirstlastcell()
mc = 4 '"d"
fr = Cells(2, mc).End(xlDown).Row
lr = Cells(Rows.Count, mc).End(xlUp).Row
Range(Cells(fr, mc), Cells(lr, mc)).Offset(, -1).Select
'or
'Range(Cells(fr, mc-1), Cells(lr, mc-1)).Select
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"Gene Augustin" wrote in message
m...
I need a macro to select from the first non-blank cell (containing data) to
the last non-blank cell in a row containing data. There are blank cells
between the first and last cell containing data.
I then want to move that selected range (not the data) to another row.
Something like:
FirstCell = first non-blank cell
LastCell = last non blank cell
Range = (firstcell,lastcell)
Range.Offset(-1,0)
Gene