Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
First empty row after last used row
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
First empty row after last used row
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 -- Don Guillett SalesAid Software "Juan" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
First empty row after last used row
Cells(Rows.Count,"A").End(xlUp)..Offset(1,0).Selec t
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) "Juan" wrote in message ... 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
First empty row after last used row
Juan
The first empty row is.... RangeRange("A65536").End(xlUp).Offset(1, 0).EntireRow.Select Gord Dibben Excel MVP On Thu, 22 Apr 2004 15:09:19 -0700, "Juan" wrote: 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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
First empty row after last used row
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 -- Message posted from http://www.ExcelForum.com |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
First empty row after last used row
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 -----Original Message----- 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 -- Don Guillett SalesAid Software "Juan" wrote in message ... 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 . |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
First empty row after last used row
Sub ss()
Dim r As Long r = Cells.Find(what:="*", SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row + 1 ' format range as required 'Range("a" & r & ":o" & r).Select 'Selection.Font.Bold = True Range("a" & r & ":o" & r).Font.Bold = True Cells(r, "a").Value = "Total" Cells(r, "c").FormulaR1C1 = "=sum(c1:c" & r - 1 & ")" End Su -- Message posted from http://www.ExcelForum.com |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
First empty row after last used row
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 -----Original Message----- Sub ss() Dim r As Long r = Cells.Find(what:="*", SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row + 1 ' format range as required 'Range("a" & r & ":o" & r).Select 'Selection.Font.Bold = True Range("a" & r & ":o" & r).Font.Bold = True Cells(r, "a").Value = "Total" Cells(r, "c").FormulaR1C1 = "=sum(c1:c" & r - 1 & ")" End Sub --- Message posted from http://www.ExcelForum.com/ . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
why a reference to an empty cell is not considered empty | Excel Discussion (Misc queries) | |||
in excel..:can't empty clip are" but already empty | Excel Discussion (Misc queries) | |||
Excel - Autom. Filter "Empty / Non Empty cells" should come first | Excel Discussion (Misc queries) | |||
How can I convert empty strings to empty cells? | Excel Discussion (Misc queries) | |||
Can blank cells created using empty Double-Quotes not be empty?? | Excel Programming |