Re: circular error
- From: "gavin" <theslider@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 31 Jan 2008 19:23:06 GMT
Hi Gord,
I tried the code this morning at work but I got an error. I have uploaded
the error screens to Flickr here:
http://www.flickr.com/photos/13882468@N04/2232610943/
http://www.flickr.com/photos/13882468@N04/2232611043/
Can you determine from those what the problem is? Have I done something
wrong?
Regards,
Gavin
"Gord Dibben" <gorddibbATshawDOTca> wrote in message
news:h2s1q3doil4vuhg976g3lp7872h064i9s9@xxxxxxxxxx
You can have an accumulator cell but only if you use another cell for
input and
only when adding, not multiplying.
For multiplying you would need VBA event code.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
With Target
If .Value <> "" Then
.Value = .Value * 23 'fixed given number
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub
Right-click on the *** tab and "View code". Copy/paste the code into
that
*** module.
Gord Dibben MS Excel MVP
On Wed, 30 Jan 2008 20:12:30 GMT, "gavin"
<theslider@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I think this is a stupid question but I'm going to ask anyway :-)
Actually
it's on behalf of a friend of mine and I've told him it's not possible but
I
thought I would check with the experts!
Is it possible to enter a number into a cell and have the cell display
that
number multiplied by a given number in that same cell? I don't think this
is
possible because of a circular error. I don't even know why he would want
to
achieve this, he hasn't told me. Is there way of doing this at all - maybe
using VBA?
.
- Follow-Ups:
- Re: circular error
- From: Gord Dibben
- Re: circular error
- References:
- circular error
- From: gavin
- Re: circular error
- From: Gord Dibben
- circular error
- Prev by Date: Re: need help on criteria
- Next by Date: Re: Error 440
- Previous by thread: Re: circular error
- Next by thread: Re: circular error
- Index(es):