First empty row after last used row

J

Juan

Hello,
I want to format the first empty row after the last used
row. IF I use
Range("A65536").End(xlUp).EntireRow.Select
But this won't work. Been locking for similar post but the
ones I tried i can't seem to get it to work.
Can anyone give some info?
I want to put totals on this row.

Thanks,

juan
 
D

Don Guillett

this
Range("A65536").End(xlUp).row+1.EntireRow.Select
or
Cells(Rows.Count, 1).End(xlUp)(2).EntireRow.Select
or
Rows(Cells(Rows.Count, 1).End(xlUp).Row + 1).Select
or
 
B

Bob Phillips

Cells(Rows.Count,"A").End(xlUp)..Offset(1,0).Select

but you probably don't need the select, you can do most things without
selecting

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
G

Gord Dibben

Juan

The first empty row is....

RangeRange("A65536").End(xlUp).Offset(1, 0).EntireRow.Select

Gord Dibben Excel MVP
 
M

mudraker

All the posted examples assume that column a will have an entry in th
last row used


This will give you the last row used without being depending on testin
any particular column


Rows(Cells.Find(what:="*", SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row + 1).Selec
 
J

Juan

Hello Don/Bob,
thanks tested both or yours and seem fine. Using the
Entirerow, I format the whole row which I don't want. If I
used the one without ENtirerow, I can only figure out how
to format Column A. I want to format Column A-O( In column
A I want to put the word TOTAL and in column C I want to
do a Sum. Do I have to do like an IF/then?

Please advise if this can be done. I'm trying different
ways but can't see to do it.

As always appreciate all the help.

thanks,

juan
 
D

Don Guillett

x=Cells(Rows.Count, 1).End(xlUp).Row + 1
range(cells(x,"a"),cells(x,"o")).formathoweveryouwanttoformatit
cells(x,"a")=application.sum(whateveryouwanttosum)
 
M

mudraker

Sub ss()
Dim r As Long
r = Cells.Find(what:="*", SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row + 1
' format range as required
'Range("a" & r & ":eek:" & r).Select
'Selection.Font.Bold = True
Range("a" & r & ":eek:" & r).Font.Bold = True
Cells(r, "a").Value = "Total"
Cells(r, "c").FormulaR1C1 = "=sum(c1:c" & r - 1 & ")"
End Su
 
J

Juan

Hello Mudraker,
Thanks, FYI, this part of the code
Cells(r, "c").FormulaR1C1 = "=sum(c1:c" & r - 1 & ")"
didn't work property but I figured out and fixed it.
Here's what I came with and works fine:
Cells(r, "c").Value = "=sum(c1:c" & r - 1 & ")"

Thanks for your great help and also all of the rest of you
who provided me with options.

Juan
 
Top