Can I put Data in a Cell that has a Function in it????

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I was wondering if it is possible to enter data into a cell on the worksheet and there also being a function in that cell to

For Example cell A1 I enter data of '50' and the function automatically adds '100' leaving the data displayed in cell A1 as'150

Any help much appreciate
 
I think I'd use a helper cell (adjacent???)

=a1+100

You could use a worksheet event that adds 100 to a cell, but why not just use an
additional cell?
 
Hi Sarah
you can do this by using the worksheet_change event. But I won'
recommend it. Better to use a different cell for input and formula. But
if you like put the following code in your worksheet module:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub
If Target.Cells.Count > 1 Then Exit Sub
On Error GoTo CleanUp
With Target
If .Value <> "" Then
Application.EnableEvents = False
.Value = .Value +100
End If
End With

CleanUp:
Application.EnableEvents = True
End Sub

This will add 100 to each entrys in cell A1

HTH
Frank
 
Back
Top