View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Syntax to select all data

If you didn't have any empty columns or empty rows in that range, Tom's
suggestion may have worked nicely.

But...

dim LastRow as long
dim myRng as range

with activesheet
lastrow = .cells(.rows.count,"A").end(xlup).row
set myrng = .range("a1:H" & Lastrow)
end with

It still uses column A to find the last used row, though.

Stephen wrote:

Perhaps I am not being clear enough. The data I am referring to will be
import from another sources and not entered manually. I don't know if the
above code will help. I believe this will get me the last row of data:

ActiveSheet.Cells(ActiveSheet.Rows.Count, 1).End (xlUp)

but how can I combine that with that last column of data? (It will be column
'H')


--

Dave Peterson