My function say in cell a2 (=prevDay(a1)) puts the value
from cell a1 of the previous day into cell a2.
Sometimes I need to overwrite this value manually.
Is there a way of doing this without loosing
the formula in a2?
thanks in advance,
/mark
www.OfficeArticles.com
www.MyExpertsOnline.com
"Mark Dvorkin" <mdvo...@rcn.com> wrote in message
news:42D075A9...@rcn.com...
www.OfficeArticles.com
www.MyExpertsOnline.com
"Mark Dvorkin" <mdvo...@rcn.com> wrote in message
news:42D07E86...@rcn.com...
Unfortunately, this cannot be done.
Maybe use a helper cell when you need to manually enter some other value.
Then in the current formula, test the helper cell for being blank. If the
helper cell is blank then the formula stays as is. If the helper cell is not
blank then use the helper cell in the formula.
Biff
"Mark Dvorkin" <mdvo...@rcn.com> wrote in message
news:42D075A9...@rcn.com...
Put this in your worksheet code module (right-click the worksheet tab
and choose View Code):
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Address(False, False) = "A2" Then
If IsEmpty(.Value) Then
Application.EnableEvents = False
.Formula = "=prevDay(A1)"
Application.EnableEvents = True
End If
End If
End With
End Sub
When you overwrite the formula, the value you input will stick. When you
delete that value, the code above will put the formula back into the
cell.
In article <42D075A9...@rcn.com>, Mark Dvorkin <mdvo...@rcn.com>
wrote:
Very nifty!
I see the formula can't be accidentally deleted either.
Biff
"JE McGimpsey" <jemcg...@mvps.org> wrote in message
news:jemcgimpsey-8913...@msnews.microsoft.com...
At the moment I have some forumula spreading a budget based on various
user selectable options (eg previous yr, flat, etc) in another cell
drop down. one of the options is to manually input At the moment I
have used conditional formatting to turn the cell white while while
waiting for input and then pink once the formula has been overwritten.
This works well to highlight overwritten cells to make the user aware
that forumla is gone - but I would really like the formula to return if
one of the other options is selected.
I am very new to VBA but wondered if the code could help with the
above? If it is possible - could you annotate the code to explain what
it is doing?
Ruthki
--
Ruthki
------------------------------------------------------------------------
Ruthki's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=24503
View this thread: http://www.excelforum.com/showthread.php?threadid=385894
www.OfficeArticles.com
www.MyExpertsOnline.com
"Ruthki" <Ruthki.1rxzec_...@excelforum-nospam.com> wrote in
message news:Ruthki.1rxzec_...@excelforum-nospam.com...
www.OfficeArticles.com
www.MyExpertsOnline.com
"Anne Troy" <n...@officearticles.com> wrote in message
news:c08d1$42d0ca96$97c5108d$48...@allthenewsgroups.com...