A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Copy Formula down for Gord Dibben



 
 
Thread Tools Display Modes
  #1  
Old December 9th, 2003, 08:52 PM
PCOR
external usenet poster
 
Posts: n/a
Default Copy Formula down for Gord Dibben

Thanks. That looks good.BUT I could use a small change....
How would I go about using this VBA code so that the formula would be copied
to any two col to the right of the selected column.

Ian
Gord Dibben wrote in message
...
Ian

How about VBA?

Sub copydown()
Dim Lrow As Long
Lastrow = Range("A" & Rows.Count).End(xlUp).Row
Range("B1:C" & Lastrow).FillDown
End Sub

Will copy formulas in B1 and C1 down as far as you have data in Column A

Gord

On Mon, 08 Dec 2003 19:00:04 GMT, "PCOR" wrote:

No dog lol
It would depend on how many entries there were on any given days.
Ian
"Gord Dibben" gorddibbATshawDOTca wrote in message
.. .
PCOR

Still short on details.

How would you(or anyone) know when it should be 25, 300 or 1000?

There has to be some type of determining factor as in "if the dog barks

twice,
copy down 25 cells" or "if I get lucky tonight copy down 300 cells"

Gord

On Mon, 08 Dec 2003 01:09:35 GMT, "PCOR" wrote:

May be word variable is misleading.
Some days I will have to copy the formula down 25 cells others 300 and

other
could be 1000
It may never be the same
Thanks

"Gord Dibben" gorddibbATshawDOTca wrote in message
.. .
PCOR

What determines the variable?

If it is the data in an adjacent column, just double-click on the
fill-handle
of the cell with the formula to fill down to end of data in the

adjacent
column.

Fill-handle is the little black square on the lower-right corner of

the
cell.

If variable is something else, post back. You will probably need

code.

Gord Dibben XL2002



On Mon, 08 Dec 2003 00:20:16 GMT, "PCOR"

wrote:

I would like to place a formula in a cell(not always the same cell

but
where
the cursor is located) then copy that formula down to as little

25
and
to
a max of 1000 cells below(The end of copy is variable.)
Thanks








--
Norton Professional 2004 says this email is clean...believe it


  #2  
Old December 10th, 2003, 08:34 PM
Gord Dibben
external usenet poster
 
Posts: n/a
Default Copy Formula down for Gord Dibben

Ian

Sorry not to get back earlier. There are better ways to do this but this one
works.

If data in activecell column is contiguous(no blanks)...........

Sub Auto_Fill()
Dim Lrow As Long
Lrow = ActiveCell.End(xlDown).Row
ActiveCell.Offset(0, 1).Range("A1:B1").Select
Selection.AutoFill Destination:=ActiveCell.Range("A1:B" & Lrow)
End Sub

Don't worry about the A1:B1. Excel knows where it is.

Gord

On Tue, 09 Dec 2003 20:52:56 GMT, "PCOR" wrote:

Thanks. That looks good.BUT I could use a small change....
How would I go about using this VBA code so that the formula would be copied
to any two col to the right of the selected column.

Ian
Gord Dibben wrote in message
.. .
Ian

How about VBA?

Sub copydown()
Dim Lrow As Long
Lastrow = Range("A" & Rows.Count).End(xlUp).Row
Range("B1:C" & Lastrow).FillDown
End Sub

Will copy formulas in B1 and C1 down as far as you have data in Column A

Gord

On Mon, 08 Dec 2003 19:00:04 GMT, "PCOR" wrote:

No dog lol
It would depend on how many entries there were on any given days.
Ian
"Gord Dibben" gorddibbATshawDOTca wrote in message
.. .
PCOR

Still short on details.

How would you(or anyone) know when it should be 25, 300 or 1000?

There has to be some type of determining factor as in "if the dog barks
twice,
copy down 25 cells" or "if I get lucky tonight copy down 300 cells"

Gord

On Mon, 08 Dec 2003 01:09:35 GMT, "PCOR" wrote:

May be word variable is misleading.
Some days I will have to copy the formula down 25 cells others 300 and
other
could be 1000
It may never be the same
Thanks

"Gord Dibben" gorddibbATshawDOTca wrote in message
.. .
PCOR

What determines the variable?

If it is the data in an adjacent column, just double-click on the
fill-handle
of the cell with the formula to fill down to end of data in the
adjacent
column.

Fill-handle is the little black square on the lower-right corner of

the
cell.

If variable is something else, post back. You will probably need

code.

Gord Dibben XL2002



On Mon, 08 Dec 2003 00:20:16 GMT, "PCOR"

wrote:

I would like to place a formula in a cell(not always the same cell

but
where
the cursor is located) then copy that formula down to as little

25
and
to
a max of 1000 cells below(The end of copy is variable.)
Thanks






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:40 AM.


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