Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22
Default Finding the last unused row in a column

This is an example of how I would like the file to look:

Column A Column B
123456 5.00
123456 5.00
123456 5.00
ABCDEFG 15.00

The ABCDEFG is the account I would like to add at the bottom of the file.
The 15.00 is the column that I would like to sum =sum(B1:whatever). The
issue I am running
into is that the row number changes every month depending on how many pulls
in the report I run. This is what I was trying to use
but it placed the account number in every row under column A. I didn't know
where to even begin for the sum formula.. I would like to incorporate this
into the macro that I currently run... Any suggestions?

Range("A2").Select
LastRow = Cells(Rows.Count, "E").End(xlUp).Row
Range("A2").Resize(LastRow - 1).FormulaR1C1 = "4651020098"

--
Thanks a bunch!
rojobrown


--
Thanks a bunch!
rojobrown
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Finding the last unused row in a column

Sub addcol()
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
Cells(lastrow + 1, "a") = "ABCDEFG"
Cells(lastrow + 1, "a").Value = _
Application.Sum(Range("b2:b" & lastrow))
End Sub

--
Don Guillett
SalesAid Software

"rojobrown" wrote in message
...
Is this for the sum formula or the first one? Do I need to put something
between the parenthesis?
Sub addcol()
--
Thanks a bunch!
rojobrown


"Don Guillett" wrote:

something like
Sub addcol()
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
Cells(lastrow + 1, "a").Value = _
Application.Sum(Range("a2:a" & lastrow))


End Sub
--
Don Guillett
SalesAid Software

"rojobrown" wrote in message
...
This is an example of how I would like the file to look:

Column A Column B
123456 5.00
123456 5.00
123456 5.00
ABCDEFG 15.00

The ABCDEFG is the account I would like to add at the bottom of the
file.
The 15.00 is the column that I would like to sum =sum(B1:whatever).
The
issue I am running
into is that the row number changes every month depending on how many
pulls
in the report I run. This is what I was trying to use
but it placed the account number in every row under column A. I didn't
know
where to even begin for the sum formula.. I would like to incorporate
this
into the macro that I currently run... Any suggestions?

Range("A2").Select
LastRow = Cells(Rows.Count, "E").End(xlUp).Row
Range("A2").Resize(LastRow - 1).FormulaR1C1 = "4651020098"

--
Thanks a bunch!
rojobrown


--
Thanks a bunch!
rojobrown






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Finding the last unused row in a column

Cells(lastrow + 1, "B").Value = _


--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...
Sub addcol()
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
Cells(lastrow + 1, "a") = "ABCDEFG"
Cells(lastrow + 1, "a").Value = _
Application.Sum(Range("b2:b" & lastrow))
End Sub

--
Don Guillett
SalesAid Software

"rojobrown" wrote in message
...
Is this for the sum formula or the first one? Do I need to put something
between the parenthesis?
Sub addcol()
--
Thanks a bunch!
rojobrown


"Don Guillett" wrote:

something like
Sub addcol()
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
Cells(lastrow + 1, "a").Value = _
Application.Sum(Range("a2:a" & lastrow))


End Sub
--
Don Guillett
SalesAid Software

"rojobrown" wrote in message
...
This is an example of how I would like the file to look:

Column A Column B
123456 5.00
123456 5.00
123456 5.00
ABCDEFG 15.00

The ABCDEFG is the account I would like to add at the bottom of the
file.
The 15.00 is the column that I would like to sum =sum(B1:whatever).
The
issue I am running
into is that the row number changes every month depending on how many
pulls
in the report I run. This is what I was trying to use
but it placed the account number in every row under column A. I
didn't
know
where to even begin for the sum formula.. I would like to incorporate
this
into the macro that I currently run... Any suggestions?

Range("A2").Select
LastRow = Cells(Rows.Count, "E").End(xlUp).Row
Range("A2").Resize(LastRow - 1).FormulaR1C1 = "4651020098"

--
Thanks a bunch!
rojobrown


--
Thanks a bunch!
rojobrown









  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22
Default Finding the last unused row in a column

I've included it in my macro but still keep getting the error "compile error:
Expected End Sub"... I've tried removing it but it still doesn't work. Any
suggestions?
--
Thanks a bunch!
rojobrown


"Don Guillett" wrote:

Cells(lastrow + 1, "B").Value = _


--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...
Sub addcol()
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
Cells(lastrow + 1, "a") = "ABCDEFG"
Cells(lastrow + 1, "a").Value = _
Application.Sum(Range("b2:b" & lastrow))
End Sub

--
Don Guillett
SalesAid Software

"rojobrown" wrote in message
...
Is this for the sum formula or the first one? Do I need to put something
between the parenthesis?
Sub addcol()
--
Thanks a bunch!
rojobrown


"Don Guillett" wrote:

something like
Sub addcol()
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
Cells(lastrow + 1, "a").Value = _
Application.Sum(Range("a2:a" & lastrow))


End Sub
--
Don Guillett
SalesAid Software

"rojobrown" wrote in message
...
This is an example of how I would like the file to look:

Column A Column B
123456 5.00
123456 5.00
123456 5.00
ABCDEFG 15.00

The ABCDEFG is the account I would like to add at the bottom of the
file.
The 15.00 is the column that I would like to sum =sum(B1:whatever).
The
issue I am running
into is that the row number changes every month depending on how many
pulls
in the report I run. This is what I was trying to use
but it placed the account number in every row under column A. I
didn't
know
where to even begin for the sum formula.. I would like to incorporate
this
into the macro that I currently run... Any suggestions?

Range("A2").Select
LastRow = Cells(Rows.Count, "E").End(xlUp).Row
Range("A2").Resize(LastRow - 1).FormulaR1C1 = "4651020098"

--
Thanks a bunch!
rojobrown


--
Thanks a bunch!
rojobrown








  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Finding the last unused row in a column

It might be helpful if you posted your entire macro. No mindreader

--
Don Guillett
SalesAid Software

"rojobrown" wrote in message
...
I've included it in my macro but still keep getting the error "compile
error:
Expected End Sub"... I've tried removing it but it still doesn't work.
Any
suggestions?
--
Thanks a bunch!
rojobrown


"Don Guillett" wrote:

Cells(lastrow + 1, "B").Value = _


--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...
Sub addcol()
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
Cells(lastrow + 1, "a") = "ABCDEFG"
Cells(lastrow + 1, "a").Value = _
Application.Sum(Range("b2:b" & lastrow))
End Sub

--
Don Guillett
SalesAid Software

"rojobrown" wrote in message
...
Is this for the sum formula or the first one? Do I need to put
something
between the parenthesis?
Sub addcol()
--
Thanks a bunch!
rojobrown


"Don Guillett" wrote:

something like
Sub addcol()
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
Cells(lastrow + 1, "a").Value = _
Application.Sum(Range("a2:a" & lastrow))


End Sub
--
Don Guillett
SalesAid Software

"rojobrown" wrote in message
...
This is an example of how I would like the file to look:

Column A Column B
123456 5.00
123456 5.00
123456 5.00
ABCDEFG 15.00

The ABCDEFG is the account I would like to add at the bottom of the
file.
The 15.00 is the column that I would like to sum =sum(B1:whatever).
The
issue I am running
into is that the row number changes every month depending on how
many
pulls
in the report I run. This is what I was trying to use
but it placed the account number in every row under column A. I
didn't
know
where to even begin for the sum formula.. I would like to
incorporate
this
into the macro that I currently run... Any suggestions?

Range("A2").Select
LastRow = Cells(Rows.Count, "E").End(xlUp).Row
Range("A2").Resize(LastRow - 1).FormulaR1C1 = "4651020098"

--
Thanks a bunch!
rojobrown


--
Thanks a bunch!
rojobrown










  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22
Default Finding the last unused row in a column

I figured it out. Thanks.
--
Thanks a bunch!
rojobrown


"Don Guillett" wrote:

It might be helpful if you posted your entire macro. No mindreader

--
Don Guillett
SalesAid Software

"rojobrown" wrote in message
...
I've included it in my macro but still keep getting the error "compile
error:
Expected End Sub"... I've tried removing it but it still doesn't work.
Any
suggestions?
--
Thanks a bunch!
rojobrown


"Don Guillett" wrote:

Cells(lastrow + 1, "B").Value = _


--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...
Sub addcol()
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
Cells(lastrow + 1, "a") = "ABCDEFG"
Cells(lastrow + 1, "a").Value = _
Application.Sum(Range("b2:b" & lastrow))
End Sub

--
Don Guillett
SalesAid Software

"rojobrown" wrote in message
...
Is this for the sum formula or the first one? Do I need to put
something
between the parenthesis?
Sub addcol()
--
Thanks a bunch!
rojobrown


"Don Guillett" wrote:

something like
Sub addcol()
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
Cells(lastrow + 1, "a").Value = _
Application.Sum(Range("a2:a" & lastrow))


End Sub
--
Don Guillett
SalesAid Software

"rojobrown" wrote in message
...
This is an example of how I would like the file to look:

Column A Column B
123456 5.00
123456 5.00
123456 5.00
ABCDEFG 15.00

The ABCDEFG is the account I would like to add at the bottom of the
file.
The 15.00 is the column that I would like to sum =sum(B1:whatever).
The
issue I am running
into is that the row number changes every month depending on how
many
pulls
in the report I run. This is what I was trying to use
but it placed the account number in every row under column A. I
didn't
know
where to even begin for the sum formula.. I would like to
incorporate
this
into the macro that I currently run... Any suggestions?

Range("A2").Select
LastRow = Cells(Rows.Count, "E").End(xlUp).Row
Range("A2").Resize(LastRow - 1).FormulaR1C1 = "4651020098"

--
Thanks a bunch!
rojobrown


--
Thanks a bunch!
rojobrown











  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Finding the last unused row in a column

It would still be helpful, for archival purposes, to post your entire macro.

--
Don Guillett
SalesAid Software

"rojobrown" wrote in message
...
I figured it out. Thanks.
--
Thanks a bunch!
rojobrown


"Don Guillett" wrote:

It might be helpful if you posted your entire macro. No mindreader

--
Don Guillett
SalesAid Software

"rojobrown" wrote in message
...
I've included it in my macro but still keep getting the error "compile
error:
Expected End Sub"... I've tried removing it but it still doesn't work.
Any
suggestions?
--
Thanks a bunch!
rojobrown


"Don Guillett" wrote:

Cells(lastrow + 1, "B").Value = _


--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...
Sub addcol()
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
Cells(lastrow + 1, "a") = "ABCDEFG"
Cells(lastrow + 1, "a").Value = _
Application.Sum(Range("b2:b" & lastrow))
End Sub

--
Don Guillett
SalesAid Software

"rojobrown" wrote in message
...
Is this for the sum formula or the first one? Do I need to put
something
between the parenthesis?
Sub addcol()
--
Thanks a bunch!
rojobrown


"Don Guillett" wrote:

something like
Sub addcol()
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
Cells(lastrow + 1, "a").Value = _
Application.Sum(Range("a2:a" & lastrow))


End Sub
--
Don Guillett
SalesAid Software

"rojobrown" wrote in message
...
This is an example of how I would like the file to look:

Column A Column B
123456 5.00
123456 5.00
123456 5.00
ABCDEFG 15.00

The ABCDEFG is the account I would like to add at the bottom of
the
file.
The 15.00 is the column that I would like to sum
=sum(B1:whatever).
The
issue I am running
into is that the row number changes every month depending on how
many
pulls
in the report I run. This is what I was trying to use
but it placed the account number in every row under column A. I
didn't
know
where to even begin for the sum formula.. I would like to
incorporate
this
into the macro that I currently run... Any suggestions?

Range("A2").Select
LastRow = Cells(Rows.Count, "E").End(xlUp).Row
Range("A2").Resize(LastRow - 1).FormulaR1C1 = "4651020098"

--
Thanks a bunch!
rojobrown


--
Thanks a bunch!
rojobrown













Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Column picked randomly with probability relative to number of entr Neil Goldwasser Excel Worksheet Functions 4 May 30th 06 08:55 AM
Finding the closest number in column A and take the value in column B reefguy Excel Worksheet Functions 3 May 5th 06 07:25 PM
Conditional Format as a MACRO Gunjani Excel Worksheet Functions 3 March 29th 06 05:22 PM
IF/AND/OR/DATEIF Issue...sorry...long post... EDSTAFF Excel Worksheet Functions 1 November 10th 05 12:28 AM
Running total w/2 columns - Excel Anna / Ideal Excel Worksheet Functions 14 August 10th 05 04:28 PM


All times are GMT +1. The time now is 01:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"