View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Ragnar Midtskogen Ragnar Midtskogen is offline
external usenet poster
 
Posts: 18
Default Find first empty row

Bob,

There is just text. The first row has column header text strings in the
first 10 to 12 columns.
I have typed in some short text strings in some of hte firs rows, for
testing purposes.
That is it, no formulas, no macros.
I had changed the font in column 1 to Marlett, but changing it back did not
make any difference.

Ragnar

"Bob Phillips" wrote in message
...
You shouldn't do. You will get an error 91 if the whole worksheet is blank
but I am at a loss as to what could cause error 13. What do you have on
the
worksheet?

--
HTH

Bob Phillips

"Ragnar Midtskogen" wrote in message
...
Thank you Bob,

Maybe I am missing something here, but when I try that I get runtime
error
13, type mismatch.
I tried deleting the wildcard character, then I get no error but it

returns
0.

Ragnar

"Bob Phillips" wrote in message
...
Try this to find the last row over many columns

Function LastRow() As Long
LastRow = Cells.Find(What:="*", _
After:=Range("A1"), _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
End Function


--
HTH

Bob Phillips

"Ragnar Midtskogen" wrote in message
...
Hello,

I need to find the first empty row in a worksheet. The sheet is just

used
to
enter text in, has no formulas.
I have Googled this and I am somewhat confused, there appears to be

many
definitions of what is empty and many ways to find the row.
I have found something that seems to work, but I don't quite
understand
how
it works

iRow = objCurrentSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)Row

First, it looks like it just looks at column 1.
It looks like it starts at the last row and moves the top of the range

up
until it finds something in a cell, but I don't see how it determines
when
a
cell contains something.

I need to scan several columns, so even if this code works how would I
expand the area scanned?

I have something that scans entire rows, I could use that but would
prefer
to limit the scan to the first n columns, in case someone happened to
enter
something outside the matrix to be used.

Any help would be appreciated.

Ragnar