Home |
Search |
Today's Posts |
#5
![]() |
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Display answer only in another cell of one containing a formula | Excel Discussion (Misc queries) | |||
inserting data from a row to a cell, when the row number is specified by a formula in a cell | New Users to Excel | |||
How do I replace a negative number at the end of a formula with a. | Excel Discussion (Misc queries) | |||
Cell contents vs. Formula contents | Excel Discussion (Misc queries) | |||
How do identify a blank cell in a formula | Excel Discussion (Misc queries) |