#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Auto ReCalc

I have an ID number that is automatically calculated/constructed from values
in other fields. When the user adds a row, the formula is automatically
added and the ID number calculated for the added row. However, when the
user deletes a row, I get #REF! in the cell. I have a menu option that
allows the user to recalculate all the ID numbers when this happens - but
they often forget. I would like to remove the menu item and have the app
recalculate automatically when the user deletes a row so they don't have to
think about it.

If I put "call RecalcID" in the workbook SheetChange event or the
SheetCalculate event, I get an endless loop because each time RecalcID is
run, it changes the workbook.

How can I run RecalcID only once when the user deletes a row?

TIA
GMet


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Auto ReCalc

Hi
you may post the formula which you're currently using

--
Regards
Frank Kabel
Frankfurt, Germany

"GMet" schrieb im Newsbeitrag
...
I have an ID number that is automatically calculated/constructed from

values
in other fields. When the user adds a row, the formula is

automatically
added and the ID number calculated for the added row. However, when

the
user deletes a row, I get #REF! in the cell. I have a menu option

that
allows the user to recalculate all the ID numbers when this happens -

but
they often forget. I would like to remove the menu item and have the

app
recalculate automatically when the user deletes a row so they don't

have to
think about it.

If I put "call RecalcID" in the workbook SheetChange event or the
SheetCalculate event, I get an endless loop because each time

RecalcID is
run, it changes the workbook.

How can I run RecalcID only once when the user deletes a row?

TIA
GMet



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 968
Default Auto ReCalc

Application.EnableEvents=false
call RecalcId
Application.enablevents=True


Charles
______________________
Decision Models
FastExcel 2.1 now available
www.DecisionModels.com

"GMet" wrote in message
...
I have an ID number that is automatically calculated/constructed from
values
in other fields. When the user adds a row, the formula is automatically
added and the ID number calculated for the added row. However, when the
user deletes a row, I get #REF! in the cell. I have a menu option that
allows the user to recalculate all the ID numbers when this happens - but
they often forget. I would like to remove the menu item and have the app
recalculate automatically when the user deletes a row so they don't have
to
think about it.

If I put "call RecalcID" in the workbook SheetChange event or the
SheetCalculate event, I get an endless loop because each time RecalcID is
run, it changes the workbook.

How can I run RecalcID only once when the user deletes a row?

TIA
GMet




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Auto ReCalc

Here is the ReCalcID macro.

Sub RecalcID()
'This macro will recalculate IMS ID numbers
col = Range("EACT")
mycol = Cells(1, col).Value
'check of tab is an Event tab
If Cells(1, Range("EACT")).Value < "EACT" Then
MsgBox "Incorrect tab - must select an Event tab"
Exit Sub
End If
'capture name of current sheet
thissheet = ActiveSheet.Name
'capture current row
cRow = Selection.Row
'data rows always start at row 4
Row = 4
Range("A4").Select
'count number of data rows
lastrow = Cells(Rows.Count, 11).End(xlUp).Row
Application.CutCopyMode = False
'copy template of formula into row 4 of selected sheet
Sheets("CalcFormula").Range("A4:H4").Copy Sheets(thissheet).Range("A4")
'select data range
Range("A4:H" & lastrow).Select
Selection.Copy
Selection.FillDown
Range("a" & cRow).Select
End Sub

GMet

"GMet" wrote in message
...
I have an ID number that is automatically calculated/constructed from

values
in other fields. When the user adds a row, the formula is automatically
added and the ID number calculated for the added row. However, when the
user deletes a row, I get #REF! in the cell. I have a menu option that
allows the user to recalculate all the ID numbers when this happens - but
they often forget. I would like to remove the menu item and have the app
recalculate automatically when the user deletes a row so they don't have

to
think about it.

If I put "call RecalcID" in the workbook SheetChange event or the
SheetCalculate event, I get an endless loop because each time RecalcID is
run, it changes the workbook.

How can I run RecalcID only once when the user deletes a row?

TIA
GMet




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Auto ReCalc

Charles,
Thank you!! Works great!!

GMet

"Charles Williams" wrote in message
...
Application.EnableEvents=false
call RecalcId
Application.enablevents=True


Charles
______________________
Decision Models
FastExcel 2.1 now available
www.DecisionModels.com

"GMet" wrote in message
...
I have an ID number that is automatically calculated/constructed from
values
in other fields. When the user adds a row, the formula is automatically
added and the ID number calculated for the added row. However, when the
user deletes a row, I get #REF! in the cell. I have a menu option that
allows the user to recalculate all the ID numbers when this happens -

but
they often forget. I would like to remove the menu item and have the

app
recalculate automatically when the user deletes a row so they don't have
to
think about it.

If I put "call RecalcID" in the workbook SheetChange event or the
SheetCalculate event, I get an endless loop because each time RecalcID

is
run, it changes the workbook.

How can I run RecalcID only once when the user deletes a row?

TIA
GMet






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
Can't stop recalc [email protected] Excel Worksheet Functions 2 April 24th 09 01:29 PM
cell does not recalc revdeacon Excel Worksheet Functions 3 December 2nd 08 09:51 PM
Excel auto recalc is occuring with no change to data. Help! Andy Excel Discussion (Misc queries) 0 March 23rd 06 04:41 PM
Automatic Recalc DME Excel Worksheet Functions 1 March 21st 05 08:05 PM
recalc question Bura Tino Excel Programming 2 July 10th 03 02:47 PM


All times are GMT +1. The time now is 09:02 AM.

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"