Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copy Row Of Formulas After Last Used Row?

Hello all. I've seen this done before, but have no idea how to do it, or
what it is even called.

I have a worksheet with Row 1 containing headers, and Row 2 containing the
formulas I want to use for subsequent rows (it is just these two lines for
now, but will grow over the next few months). Some cells in Row 2 have
formulas, but most do not. Is there a way that I can automatically copy
those formulas to the next empty row if the current last row has data in it?
I realize that I can just select the cells and drag the handle down far
enough to cover myself, but what I'm trying to avoid is having hundreds of
lines of formulas that aren't doing anything (thus increasing file size).

Thanks in advance


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy Row Of Formulas After Last Used Row?

Turn on the macro recorder and do it manually. This should give you the
basic code. Then you can read help about the methods recorded and see how
to adjust it to do what you want.

--
Regards,
Tom Ogilvy

"M. Johnson" wrote in message
...
Hello all. I've seen this done before, but have no idea how to do it, or
what it is even called.

I have a worksheet with Row 1 containing headers, and Row 2 containing the
formulas I want to use for subsequent rows (it is just these two lines for
now, but will grow over the next few months). Some cells in Row 2 have
formulas, but most do not. Is there a way that I can automatically copy
those formulas to the next empty row if the current last row has data in

it?
I realize that I can just select the cells and drag the handle down far
enough to cover myself, but what I'm trying to avoid is having hundreds of
lines of formulas that aren't doing anything (thus increasing file size).

Thanks in advance




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copy Row Of Formulas After Last Used Row?

Funny, I started doing this just as you responded. And I succeeded, except
that I have to call my new macro at each new line. This is faster than it
was, but it would be nice if it could be called automatically. Is there a
way to do this? Say, some sort of conditional statement (I don't know VBA,
so this is plain english) where A3 is the active cell:

if activecell.range("A1")="" and activecell.offset(-1,0).range("A1")0
then run x macro
else do nothing

Just curious. Like I said in the first post, I've seen this done before (a
list that had, say, 15 lines because 90% of the time, that would be enough,
but in that 10%, it would add more lines as needed...if all that makes any
sense). Thanks again.


"Tom Ogilvy" wrote in message
...
Turn on the macro recorder and do it manually. This should give you the
basic code. Then you can read help about the methods recorded and see how
to adjust it to do what you want.

--
Regards,
Tom Ogilvy

"M. Johnson" wrote in message
...
Hello all. I've seen this done before, but have no idea how to do it,

or
what it is even called.

I have a worksheet with Row 1 containing headers, and Row 2 containing

the
formulas I want to use for subsequent rows (it is just these two lines

for
now, but will grow over the next few months). Some cells in Row 2 have
formulas, but most do not. Is there a way that I can automatically copy
those formulas to the next empty row if the current last row has data in

it?
I realize that I can just select the cells and drag the handle down far
enough to cover myself, but what I'm trying to avoid is having hundreds

of
lines of formulas that aren't doing anything (thus increasing file

size).

Thanks in advance






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy Row Of Formulas After Last Used Row?

Automatically means something has to trigger the action. Excel provides
events which fire when certain activities take place. For the worksheet
some of the key events are Calculate, SelectionChange, Change.

You could put your code in one of these events. In the event code, you
would check how many rows with formula have not been filled in yet and when
it goes below a certain level, you could add rows.

See Chip Pearson's page on events as a start.

http://www.cpearson.com/excel/events.htm


--
Regards,
Tom Ogilvy


"M. Johnson" wrote in message
...
Funny, I started doing this just as you responded. And I succeeded,

except
that I have to call my new macro at each new line. This is faster than it
was, but it would be nice if it could be called automatically. Is there a
way to do this? Say, some sort of conditional statement (I don't know

VBA,
so this is plain english) where A3 is the active cell:

if activecell.range("A1")="" and activecell.offset(-1,0).range("A1")0
then run x macro
else do nothing

Just curious. Like I said in the first post, I've seen this done before

(a
list that had, say, 15 lines because 90% of the time, that would be

enough,
but in that 10%, it would add more lines as needed...if all that makes any
sense). Thanks again.


"Tom Ogilvy" wrote in message
...
Turn on the macro recorder and do it manually. This should give you the
basic code. Then you can read help about the methods recorded and see

how
to adjust it to do what you want.

--
Regards,
Tom Ogilvy

"M. Johnson" wrote in message
...
Hello all. I've seen this done before, but have no idea how to do it,

or
what it is even called.

I have a worksheet with Row 1 containing headers, and Row 2 containing

the
formulas I want to use for subsequent rows (it is just these two lines

for
now, but will grow over the next few months). Some cells in Row 2 have
formulas, but most do not. Is there a way that I can automatically

copy
those formulas to the next empty row if the current last row has data

in
it?
I realize that I can just select the cells and drag the handle down

far
enough to cover myself, but what I'm trying to avoid is having

hundreds
of
lines of formulas that aren't doing anything (thus increasing file

size).

Thanks in advance








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
Copy Formulas Loren Excel Discussion (Misc queries) 1 October 22nd 09 05:17 PM
automatically copy formulas down columns or copy formulas all the HowlingBlue Excel Worksheet Functions 1 March 16th 07 11:11 PM
How do I copy formulas but using the same range each time I copy Laffin Excel Worksheet Functions 2 June 22nd 06 04:17 PM
Copy formulas sgrech Excel Discussion (Misc queries) 6 September 22nd 05 12:06 AM
Range COPY function - how to copy VALUES and not formulas James Cooke Excel Programming 1 August 21st 03 07:04 PM


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

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

About Us

"It's about Microsoft Excel"