View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Last Column With Data

Dim myRow as long
dim LastCol as long

myrow = 1243

with worksheets("SomeSheetnamehere")
lastcol = .cells(myrow,.columns.count).end(xltoleft).column
end with

msgbox LastCol

This will break if you've used the last column in that row -- or if you haven't
used any cells in that row.

Is that a problem?



Bishop wrote:

How do I check a certain row to find out the last column in the row that has
data?


--

Dave Peterson