Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cell Input ~ Display | Excel Discussion (Misc queries) | |||
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 | Excel Discussion (Misc queries) | |||
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 | Excel Worksheet Functions | |||
How do I input 2525 to display 25.25 | Excel Discussion (Misc queries) | |||
Have user input converted to uppercase in same cell as input? | New Users to Excel |