View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Cell input to automatically divide itself


Tom, As always you are correct. However, OP did not ask for more.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Tom Ogilvy" wrote in message
...
Since you are an MVP and you posted it well after a much superior solution
was posted, I think it is fair to advise the OP that it was ill conceived.
If he implements your solution, then gets an error and events are disabled
and he wonders what happened and so forth.

And Yes, at the lowest level, it answered his question - I don't think I
said otherwise.


--
Regards,
Tom Ogilvy




"Don Guillett" wrote:

But it would do what the OP asked for.....

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Tom Ogilvy" wrote in message
...
Just a heads up to the OP.
Since this doesn't check for errors and doesn't handle errors and
attempts
to perform a math operation regardless of the value in the cell it
would
be
a poor implementation. Mike H does account for those problem.s

--
Regards,
Tom Ogilvy



"Don Guillett" wrote:

right click sheet tabview codecopy/paste this
As written, it works ONLY on column D

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 4 Then Exit Sub
Application.EnableEvents = False
Target = Target / 2
Application.EnableEvents = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Jas" wrote in message
...
Hi. I would like to know if it is possible to get the input of a
cell
to
automatically divide itself. So, if someone enters 4 in to A1, I
would
like
it to be divided by 2 and show the value 2 in the same input sell
(A1).

Can this be done, and if it can, how?

Thanks in advance
Jas