Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default VBA question

I have a list of data that changes everytime someone runs their excel
spreadsheet. ( It is populated by another software taht we us for our
database.) I want to be able to find the first blank cell (where the
list of data ends) and enter a calculation there. How can I do this
within vba? I want to find the first blank cell and enter a formula
there, I have tried everything!! Thanks in advance!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default VBA question



On Oct 9, 2:43 pm, "aggiechick717" wrote:
I have a list of data that changes everytime someone runs their excel
spreadsheet. ( It is populated by another software taht we us for our
database.) I want to be able to find the first blank cell (where the
list of data ends) and enter a calculation there. How can I do this
within vba? I want to find the first blank cell and enter a formula
there, I have tried everything!! Thanks in advance!


Assuming that there will never be an empty cell until the bottom of
your list, and that your data is in column A (if not - adapt
accordingly):

application.worksheetfunction.counta(activesheet.r ange("A:A")) + 1 is
the row number of your first empty cell. meaning that:

activesheet.range("A" &
application.worksheetfunction.counta(activesheet.r ange("A:A")) +
1).value = YOUR FORMULA

HTH

AR

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default VBA question

Range("A1").End(xlDown).Offset(1).FormulaR1C1 = "=Sum(R1C:R[-1]C)"

This will find the next empty cell in Column A then enter a Sum formula to
sum all rows above it.
--
Charles Chickering

"A good example is twice the value of good advice."


"aggiechick717" wrote:

I have a list of data that changes everytime someone runs their excel
spreadsheet. ( It is populated by another software taht we us for our
database.) I want to be able to find the first blank cell (where the
list of data ends) and enter a calculation there. How can I do this
within vba? I want to find the first blank cell and enter a formula
there, I have tried everything!! Thanks in advance!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default VBA question

Sub Lastrow()

Dim l_column As String

Range(l_column & "65535").Select
Selection.End(xlUp).Select

End Sub

Hope this helps,

Thanks

Simon

aggiechick717 wrote:
I have a list of data that changes everytime someone runs their excel
spreadsheet. ( It is populated by another software taht we us for our
database.) I want to be able to find the first blank cell (where the
list of data ends) and enter a calculation there. How can I do this
within vba? I want to find the first blank cell and enter a formula
there, I have tried everything!! Thanks in advance!


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200610/1

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default VBA question

Sorry, you will need to define l_column!



smw226 wrote:
Sub Lastrow()

Dim l_column As String
l_column = "A"
Range(l_column & "65535").Select
Selection.End(xlUp).Select

End Sub

Hope this helps,

Thanks

Simon

I have a list of data that changes everytime someone runs their excel
spreadsheet. ( It is populated by another software taht we us for our
database.) I want to be able to find the first blank cell (where the
list of data ends) and enter a calculation there. How can I do this
within vba? I want to find the first blank cell and enter a formula
there, I have tried everything!! Thanks in advance!


--
Message posted via http://www.officekb.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default VBA question

That sounds good, but when I try to do it it gives me an error. Any
ideas? I think this will work as long as I can code it in right!!
Thanks!


Charles Chickering wrote:
Range("A1").End(xlDown).Offset(1).FormulaR1C1 = "=Sum(R1C:R[-1]C)"

This will find the next empty cell in Column A then enter a Sum formula to
sum all rows above it.
--
Charles Chickering

"A good example is twice the value of good advice."


"aggiechick717" wrote:

I have a list of data that changes everytime someone runs their excel
spreadsheet. ( It is populated by another software taht we us for our
database.) I want to be able to find the first blank cell (where the
list of data ends) and enter a calculation there. How can I do this
within vba? I want to find the first blank cell and enter a formula
there, I have tried everything!! Thanks in advance!



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default VBA question

Thank you all, I got it to work!!!




smw226 via OfficeKB.com wrote:
Sorry, you will need to define l_column!



smw226 wrote:
Sub Lastrow()

Dim l_column As String
l_column = "A"
Range(l_column & "65535").Select
Selection.End(xlUp).Select

End Sub

Hope this helps,

Thanks

Simon

I have a list of data that changes everytime someone runs their excel
spreadsheet. ( It is populated by another software taht we us for our
database.) I want to be able to find the first blank cell (where the
list of data ends) and enter a calculation there. How can I do this
within vba? I want to find the first blank cell and enter a formula
there, I have tried everything!! Thanks in advance!


--
Message posted via http://www.officekb.com


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
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good davegb Excel Programming 1 May 6th 05 06:35 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 27th 05 07:46 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 23 April 23rd 05 09:26 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 22nd 05 03:30 PM


All times are GMT +1. The time now is 12:27 AM.

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"