Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default Cell display after input

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 373
Default Cell display after input

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" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default Cell display after input

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" wrote in message
...
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




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Cell display after input

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" wrote in message
...
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




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default Cell display after input

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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cell Input ~ Display Ronnie Excel Discussion (Misc queries) 2 July 16th 07 05:08 PM
Code to Query SQL Server with a parameter value (entered into an Input Box), and have that value also display in a selected cell on a worksheet Doctorjones_md Excel Discussion (Misc queries) 3 June 27th 07 04:14 PM
Code to Query SQL Server with a parameter value (entered into an Input Box), and have that value also display in a selected cell on a worksheet Doctorjones_md Excel Worksheet Functions 3 June 27th 07 04:14 PM
How do I input 2525 to display 25.25 Ferdy Excel Discussion (Misc queries) 1 March 4th 07 03:46 PM
Have user input converted to uppercase in same cell as input? Shannonn New Users to Excel 1 June 20th 06 03:19 AM


All times are GMT +1. The time now is 05:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"