Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DME DME is offline
external usenet poster
 
Posts: 4
Default Deactivate Formula

I have a worksheet that has a circualr reference in it. I need a macro or
code so I can deactivate the formula on close.
I have set up a code to set my interations on opening the file but the
spreadsheet does its calcualtions before my interation macro runs, so the
user gets a circualr reference message. It has been suggested to me to
deactivate the formula on close and then reactivate it after my interation
macro ran would work. The problem is, I am too dumb to figure out how to
deactivate the formula. Any help or advise would be appreciated. Thanks!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Deactivate Formula

You could just put a space in front of it on close, and remove that on
start-up. Let's assume the formula is in Sheet1 Range ("A1"), this code does
it

Private Sub Workbook_BeforeClose(Cancel As Boolean)
With Worksheets("Sheet2").Range("A1")
.Formula = " " & .Formula
End With

End Sub

Private Sub Workbook_Open()
With Worksheets("Sheet2").Range("A1")
If Left(.Value, 1) = " " Then
.Formula = Right(.Value, Len(.Value) - 1)
End If
End With
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"DME" <cschelskeatdmeraildotcom wrote in message
...
I have a worksheet that has a circualr reference in it. I need a macro or
code so I can deactivate the formula on close.
I have set up a code to set my interations on opening the file but the
spreadsheet does its calcualtions before my interation macro runs, so the
user gets a circualr reference message. It has been suggested to me to
deactivate the formula on close and then reactivate it after my interation
macro ran would work. The problem is, I am too dumb to figure out how to
deactivate the formula. Any help or advise would be appreciated. Thanks!




  #3   Report Post  
Posted to microsoft.public.excel.programming
DME DME is offline
external usenet poster
 
Posts: 4
Default Deactivate Formula

Thanks Bob! This worked great!
"Bob Phillips" wrote in message
...
You could just put a space in front of it on close, and remove that on
start-up. Let's assume the formula is in Sheet1 Range ("A1"), this code

does
it

Private Sub Workbook_BeforeClose(Cancel As Boolean)
With Worksheets("Sheet2").Range("A1")
.Formula = " " & .Formula
End With

End Sub

Private Sub Workbook_Open()
With Worksheets("Sheet2").Range("A1")
If Left(.Value, 1) = " " Then
.Formula = Right(.Value, Len(.Value) - 1)
End If
End With
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"DME" <cschelskeatdmeraildotcom wrote in message
...
I have a worksheet that has a circualr reference in it. I need a macro

or
code so I can deactivate the formula on close.
I have set up a code to set my interations on opening the file but the
spreadsheet does its calcualtions before my interation macro runs, so

the
user gets a circualr reference message. It has been suggested to me to
deactivate the formula on close and then reactivate it after my

interation
macro ran would work. The problem is, I am too dumb to figure out how

to
deactivate the formula. Any help or advise would be appreciated.

Thanks!






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
Deactivate Save As Alex.W Excel Discussion (Misc queries) 5 June 21st 07 11:58 AM
deactivate the get pivot formula when I link a cell to a pivot hwtradezheng New Users to Excel 1 January 4th 06 01:47 PM
Deactivate worksheet Cordobes Excel Discussion (Misc queries) 3 December 4th 05 10:16 AM
Deactivate formula after a set time y_not Excel Discussion (Misc queries) 1 September 17th 05 10:24 AM
Deactivate web toolbar Anita Excel Discussion (Misc queries) 1 January 19th 05 12:46 AM


All times are GMT +1. The time now is 01:58 PM.

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"