Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
ASU ASU is offline
external usenet poster
 
Posts: 63
Default copy and paste formula using vb code

Can anybody tell me what vb code do I use for the following:
I would like it to copy and paste formula starting from columns "H11:L11"
everytime data is inserted in the cells, the code would paste the formula
down one row automatically.

Thank you
--
ASU
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 427
Default copy and paste formula using vb code

Allow me to re-state it, to make sure I understand it properly:
When the user enters data in the range H11:L11, a formula is copied and
pasted down one row automatically.

If that is correct, where is the formula that is copied? If my
restatement is wrong, please correct it.

  #3   Report Post  
Posted to microsoft.public.excel.misc
ASU ASU is offline
external usenet poster
 
Posts: 63
Default copy and paste formula using vb code

Yes , thats correct......eg. the formula in say "H11" is copied and pasted to
"H12". Like wise with cells "I11" through to "L11". The formula in "H11" is
as follows:

=SUMIF($A$3:A3,A3,$H$11:H11)-SUMIF($A$3:A3,A3,$E11:E11)

I'v tried dragging down, each column, to row 5000. But I found that it
slowed the file when opening and closing. Other way would to use vb codes to
do the maths!
--
ASU


"Dave O" wrote:

Allow me to re-state it, to make sure I understand it properly:
When the user enters data in the range H11:L11, a formula is copied and
pasted down one row automatically.

If that is correct, where is the formula that is copied? If my
restatement is wrong, please correct it.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default copy and paste formula using vb code

Try this code:
netrang = "H11:L11"
startrng = "H11"
Range(startrng) =
"=SUMIF($A$3:A3,A3,$H$11:H11)-SUMIF($A$3:A3,A3,$E11:E11)"
Range(startrng).AutoFill Destination:=Range(netrang), Type:=xlFillDefault

Larry

"ASU" wrote:

Yes , thats correct......eg. the formula in say "H11" is copied and pasted to
"H12". Like wise with cells "I11" through to "L11". The formula in "H11" is
as follows:

=SUMIF($A$3:A3,A3,$H$11:H11)-SUMIF($A$3:A3,A3,$E11:E11)

I'v tried dragging down, each column, to row 5000. But I found that it
slowed the file when opening and closing. Other way would to use vb codes to
do the maths!
--
ASU


"Dave O" wrote:

Allow me to re-state it, to make sure I understand it properly:
When the user enters data in the range H11:L11, a formula is copied and
pasted down one row automatically.

If that is correct, where is the formula that is copied? If my
restatement is wrong, please correct it.


  #5   Report Post  
Posted to microsoft.public.excel.misc
ASU ASU is offline
external usenet poster
 
Posts: 63
Default copy and paste formula using vb code

Im afraid it doesn't work. It doesn't recognizes netrang.
Is there another way?
--
ASU


"lar.ridge" wrote:

Try this code:
netrang = "H11:L11"
startrng = "H11"
Range(startrng) =
"=SUMIF($A$3:A3,A3,$H$11:H11)-SUMIF($A$3:A3,A3,$E11:E11)"
Range(startrng).AutoFill Destination:=Range(netrang), Type:=xlFillDefault

Larry

"ASU" wrote:

Yes , thats correct......eg. the formula in say "H11" is copied and pasted to
"H12". Like wise with cells "I11" through to "L11". The formula in "H11" is
as follows:

=SUMIF($A$3:A3,A3,$H$11:H11)-SUMIF($A$3:A3,A3,$E11:E11)

I'v tried dragging down, each column, to row 5000. But I found that it
slowed the file when opening and closing. Other way would to use vb codes to
do the maths!
--
ASU


"Dave O" wrote:

Allow me to re-state it, to make sure I understand it properly:
When the user enters data in the range H11:L11, a formula is copied and
pasted down one row automatically.

If that is correct, where is the formula that is copied? If my
restatement is wrong, please correct it.


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 & paste formula between spreadsheets - not working Glibby Gibson Excel Worksheet Functions 0 May 11th 06 01:56 AM
copy paste formula to skip rows Greg Excel Worksheet Functions 1 March 8th 06 10:41 PM
convert formula to its value w/out copy and paste Allan Editor Excel Discussion (Misc queries) 3 January 12th 06 05:19 PM
How can I copy and paste the text of a formula? Jeff Excel Worksheet Functions 1 August 30th 05 03:45 PM
Copy Paste of Formula Produces Incorrect Result JLa Excel Discussion (Misc queries) 1 May 17th 05 06:56 PM


All times are GMT +1. The time now is 12:04 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"