Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
nc nc is offline
external usenet poster
 
Posts: 119
Default Use macro to write formula

I have data in the following format,

A B C D

1 Dept Qty Price Sales (Qty*Price)
2
3

1. I have a formula in column D, how can I use macro to automatically enter
the formula whenever I insert a row, e.g between row 1 and 2. Plus it will
be useful to have the macro update the formula column whenever I add new rows
at the f bottom of the list i.e in row 4.

2. Since this list will be use to enter data I would prefer not to protect
the sheet.
How can I can get macro to rewrite the formula in column D to the bottom of
the list, each time the sheet recalculates, just in case it was accidentally
deleted.







  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default Use macro to write formula

Hi,

Suppose you have only the first row filled in below the titles, and assume
these are on rows 1 and 2. Select the range A1:D2 and in Excel 2003 choose
Data, List, Create List or in 2007 choose Home, Format as Table, OK.

Now when you add a new row of data the formula will automatically be added,
no macro needed.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"nc" wrote:

I have data in the following format,

A B C D

1 Dept Qty Price Sales (Qty*Price)
2
3

1. I have a formula in column D, how can I use macro to automatically enter
the formula whenever I insert a row, e.g between row 1 and 2. Plus it will
be useful to have the macro update the formula column whenever I add new rows
at the f bottom of the list i.e in row 4.

2. Since this list will be use to enter data I would prefer not to protect
the sheet.
How can I can get macro to rewrite the formula in column D to the bottom of
the list, each time the sheet recalculates, just in case it was accidentally
deleted.







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
How to write a macro JStiehl Excel Discussion (Misc queries) 4 August 11th 08 10:08 PM
Help write Macro nc Excel Discussion (Misc queries) 5 November 17th 05 03:19 PM
How do i write a Macro that does following Gautam New Users to Excel 5 June 30th 05 08:24 AM
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? Daniel Excel Worksheet Functions 1 June 23rd 05 11:38 PM
How do I write a macro for... Christopher Anderson Excel Discussion (Misc queries) 1 December 20th 04 05:18 PM


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