Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
I'm trying to figure out a way (if there's one) to enter a number into a
blank cell and have it automatically multiply that cell by 25.4 (essentially converting a number from in. to mm.), keeping the new number in that same cell: enter 2 into A2 and it converts it to 50.8 and A2 now shows 50.8. Is this possible? Thanks. |
#2
![]() |
|||
|
|||
![]()
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit: Application.EnableEvents = False With Target If .Column = 1 Then .Value = .Value * 2.54 End If End With ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH RP (remove nothere from the email address if mailing direct) "MAWII" wrote in message ... I'm trying to figure out a way (if there's one) to enter a number into a blank cell and have it automatically multiply that cell by 25.4 (essentially converting a number from in. to mm.), keeping the new number in that same cell: enter 2 into A2 and it converts it to 50.8 and A2 now shows 50.8. Is this possible? Thanks. |
#3
![]() |
|||
|
|||
![]()
Not by formatting, do you want this in any cell in the sheet or just one cell?
Assume the latter and A2 It would take an event macro so if someone else is using it they have to enable the macro when they open the workbook, if not it won't work Riight click the sheet tab where you want this, select view code and paste in Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Intersect(Range("A2"), Target) Is Nothing Then Exit Sub Application.EnableEvents = False Target.Value = Target.Value * 25.4 Application.EnableEvents = True End Sub press alt + Q to close the VB editor now type an inch value in A2 and press enter Regards, Peo Sjoblom "MAWII" wrote: I'm trying to figure out a way (if there's one) to enter a number into a blank cell and have it automatically multiply that cell by 25.4 (essentially converting a number from in. to mm.), keeping the new number in that same cell: enter 2 into A2 and it converts it to 50.8 and A2 now shows 50.8. Is this possible? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
format cells dialog box does not come up | Excel Discussion (Misc queries) | |||
How do I get brackets in format cells accounting? | Excel Discussion (Misc queries) | |||
Combining data (numeric format) in multiple cells into one cell (t | Excel Discussion (Misc queries) | |||
How do I format cells to a specific number of digits? | Excel Discussion (Misc queries) | |||
Find cells without multiple spacebars and format... | Excel Discussion (Misc queries) |