PC Review


Reply
Thread Tools Rate Thread

Cell display after input

 
 
=?Utf-8?B?c3dpZnRjb2Rl?=
Guest
Posts: n/a
 
      20th Sep 2007
Hi,

I am wondering if i am able to change the value of an input immendiately
after pressing enter in a cell. E.g.

If i type "1000" into a cell, after i press enter it will take the 1000/100
and display a value of "10" in the cell.

Thanks
Swiftcode
 
Reply With Quote
 
 
 
 
Zone
Guest
Posts: n/a
 
      20th Sep 2007
Copy this code. Right-click on the sheet tab, select View Code, and paste
the code in there.
James

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If VarType(Target) = vbDouble Then
Target = Target / 100
End If
Application.EnableEvents = True
End Sub


"swiftcode" <(E-Mail Removed)> wrote in message
news:631A1A8B-FB36-42DE-A699-(E-Mail Removed)...
> Hi,
>
> I am wondering if i am able to change the value of an input immendiately
> after pressing enter in a cell. E.g.
>
> If i type "1000" into a cell, after i press enter it will take the
> 1000/100
> and display a value of "10" in the cell.
>
> Thanks
> Swiftcode



 
Reply With Quote
 
=?Utf-8?B?c3dpZnRjb2Rl?=
Guest
Posts: n/a
 
      20th Sep 2007
Hi James,

Thanks for your help. Your post solved the inital question, but would it be
possible to target only a specific cell.

Thanks
Swiftcode

"Zone" wrote:

> Copy this code. Right-click on the sheet tab, select View Code, and paste
> the code in there.
> James
>
> Private Sub Worksheet_Change(ByVal Target As Range)
> Application.EnableEvents = False
> If VarType(Target) = vbDouble Then
> Target = Target / 100
> End If
> Application.EnableEvents = True
> End Sub
>
>
> "swiftcode" <(E-Mail Removed)> wrote in message
> news:631A1A8B-FB36-42DE-A699-(E-Mail Removed)...
> > Hi,
> >
> > I am wondering if i am able to change the value of an input immendiately
> > after pressing enter in a cell. E.g.
> >
> > If i type "1000" into a cell, after i press enter it will take the
> > 1000/100
> > and display a value of "10" in the cell.
> >
> > Thanks
> > Swiftcode

>
>
>

 
Reply With Quote
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      20th Sep 2007
Hi,

add this to James' code:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then 'change to suit
Application.EnableEvents = False
If VarType(Target) = vbDouble Then
Target = Target / 100
End If
End If
Application.EnableEvents = True
End Sub

Mike

"swiftcode" wrote:

> Hi James,
>
> Thanks for your help. Your post solved the inital question, but would it be
> possible to target only a specific cell.
>
> Thanks
> Swiftcode
>
> "Zone" wrote:
>
> > Copy this code. Right-click on the sheet tab, select View Code, and paste
> > the code in there.
> > James
> >
> > Private Sub Worksheet_Change(ByVal Target As Range)
> > Application.EnableEvents = False
> > If VarType(Target) = vbDouble Then
> > Target = Target / 100
> > End If
> > Application.EnableEvents = True
> > End Sub
> >
> >
> > "swiftcode" <(E-Mail Removed)> wrote in message
> > news:631A1A8B-FB36-42DE-A699-(E-Mail Removed)...
> > > Hi,
> > >
> > > I am wondering if i am able to change the value of an input immendiately
> > > after pressing enter in a cell. E.g.
> > >
> > > If i type "1000" into a cell, after i press enter it will take the
> > > 1000/100
> > > and display a value of "10" in the cell.
> > >
> > > Thanks
> > > Swiftcode

> >
> >
> >

 
Reply With Quote
 
=?Utf-8?B?c3dpZnRjb2Rl?=
Guest
Posts: n/a
 
      20th Sep 2007
Hi James & Mike,

Thanks for your help. Really appreciate it.

Have a good day.

Rgds
Swiftcode

"Mike H" wrote:

> Hi,
>
> add this to James' code:-
>
> Private Sub Worksheet_Change(ByVal Target As Range)
> If Target.Address = "$A$1" Then 'change to suit
> Application.EnableEvents = False
> If VarType(Target) = vbDouble Then
> Target = Target / 100
> End If
> End If
> Application.EnableEvents = True
> End Sub
>
> Mike
>
> "swiftcode" wrote:
>
> > Hi James,
> >
> > Thanks for your help. Your post solved the inital question, but would it be
> > possible to target only a specific cell.
> >
> > Thanks
> > Swiftcode
> >
> > "Zone" wrote:
> >
> > > Copy this code. Right-click on the sheet tab, select View Code, and paste
> > > the code in there.
> > > James
> > >
> > > Private Sub Worksheet_Change(ByVal Target As Range)
> > > Application.EnableEvents = False
> > > If VarType(Target) = vbDouble Then
> > > Target = Target / 100
> > > End If
> > > Application.EnableEvents = True
> > > End Sub
> > >
> > >
> > > "swiftcode" <(E-Mail Removed)> wrote in message
> > > news:631A1A8B-FB36-42DE-A699-(E-Mail Removed)...
> > > > Hi,
> > > >
> > > > I am wondering if i am able to change the value of an input immendiately
> > > > after pressing enter in a cell. E.g.
> > > >
> > > > If i type "1000" into a cell, after i press enter it will take the
> > > > 1000/100
> > > > and display a value of "10" in the cell.
> > > >
> > > > Thanks
> > > > Swiftcode
> > >
> > >
> > >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Input cell should display a percentage of input value in the cell Sherees Microsoft Excel Misc 0 16th Dec 2009 10:25 PM
Cell Input ~ Display =?Utf-8?B?Um9ubmll?= Microsoft Excel Misc 2 16th Jul 2007 05:08 PM
display information based on cell input jlm661 Microsoft Excel Misc 1 30th Jul 2004 01:19 PM
How to use Input cell and or view as a display cell bob Microsoft Excel Programming 2 14th May 2004 12:59 PM
How to display contents of a cell in UserForm and take input ssexcel Microsoft Excel Programming 2 28th Oct 2003 12:37 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:08 PM.