LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Claes G
 
Posts: n/a
Default

mangesh,

The cell that has a formula picks up a value from a linked file.
I do want to overwrite the cell formula with a number sometimes.
I usually copy a file that has lots of other unique data that I do not want to
rewrite (I have an blank template where all cell formulas have not been
modified).
If I open an old work file and Save as new file and in the old file I have
overwritten formula cells with a number then I would like to visualize that.
In the new file I may want to use the formula but if I do not see that I have
written over the formula I can easily make a mistake and the written number
is used in the calculation.
Then the whole calculation turns out to be wrong.

Sorry but still my knowledge in VBA is very poor.
Should I add this between the lines: (anything else I need to do?)
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
IsNumeric(Range("A1").Formula)
End Sub
How can I use this in my work sheet in a particular cell where I would want
to use conditional formatting to make the cell color yellow in case I have
overwritten the
formula with another plain numeric value.

Regards,
Claes

"mangesh_yadav" skrev:


of what I understand from your first post, you need to check if a
particular cell has a formula or a number. And then you want to avoid
the user in accidental editing of a formula. Instead of checking these,
you could simply lock the cell (by default the cells are locked), or
rather, for cells where there are no formulae, you could unlock the
cell by going to FORMAT CELLS PROTECTION and unchecking the LOCKED
box. Then Protect the worksheet by going to TOLS PROTECTION PROTECT
SHEET. Password is optional.

Incase, the above is not helpful, you could write some code to check if
the cell is a formula or number in the module for that sheet.
Right-click on the sheet-name tab and click on view code. This opens
the sheet module. Here for a particular even you can write the code I
mentioned earlier. For instance
IsNumeric(Range("A1").Formula)


- Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=274418




 
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
Display answer only in another cell of one containing a formula Mally Excel Discussion (Misc queries) 5 January 21st 05 01:07 PM
inserting data from a row to a cell, when the row number is specified by a formula in a cell [email protected] New Users to Excel 2 January 6th 05 07:18 AM
How do I replace a negative number at the end of a formula with a. dealn2 Excel Discussion (Misc queries) 5 December 23rd 04 07:47 PM
Cell contents vs. Formula contents Sarah Excel Discussion (Misc queries) 3 December 15th 04 06:02 PM
How do identify a blank cell in a formula Barb123 Excel Discussion (Misc queries) 3 December 6th 04 05:50 PM


All times are GMT +1. The time now is 10:52 PM.

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"