Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
my problem:
i want to enter a number in A1 and everytime when u enter a number in a1 the macro adds the new number to the old one BUT in the end there sould be the hole thing in the cell as code... A1 A1 - 0 input "14" in A1 A1 - 14 input "10" in A1 A1 - 24 input "-2" in A1 A1 - 22 at the end A1 = "14 + 10 - 2 " = 22 so that u can controll what is typed in kind regards mario |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This may not be the most elegant solution but it works:
Public oldvalue Public Done As Boolean Private Sub Worksheet_Change(ByVal Target As Range) If Done Then Exit Sub If oldvalue = Target.Value Then Exit Sub If Target.Address = "$A$1" Then Done = True [A1] = oldvalue + Target.Value End If End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) If ActiveCell.Address < "$A$1" Then Exit Sub oldvalue = Target.Value Done = False End Sub "Mario" wrote in message y.telekom.at... my problem: i want to enter a number in A1 and everytime when u enter a number in a1 the macro adds the new number to the old one BUT in the end there sould be the hole thing in the cell as code... A1 A1 - 0 input "14" in A1 A1 - 14 input "10" in A1 A1 - 24 input "-2" in A1 A1 - 22 at the end A1 = "14 + 10 - 2 " = 22 so that u can controll what is typed in kind regards mario |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This file might be a help:
http://www.bygsoftware.com/examples/...ainFormula.zip It's in the "Worksheets with VBA" section on page: http://www.bygsoftware.com/examples/examples.htm It demonstrates how user input is captured and used to amend a formula with the "SheetSelectionChange" event. The code is open and commented. -- Regards Andy Wiggins www.BygSoftware.com Home of "Save and BackUp", "The Excel Auditor" and "Byg Tools for VBA" "Mario" wrote in message y.telekom.at... my problem: i want to enter a number in A1 and everytime when u enter a number in a1 the macro adds the new number to the old one BUT in the end there sould be the hole thing in the cell as code... A1 A1 - 0 input "14" in A1 A1 - 14 input "10" in A1 A1 - 24 input "-2" in A1 A1 - 22 at the end A1 = "14 + 10 - 2 " = 22 so that u can controll what is typed in kind regards mario |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See one solution in .m.p.excel:
In article lekom.at, "Mario" wrote: my problem: i want to enter a number in A1 and everytime when u enter a number in a1 the macro adds the new number to the old one BUT in the end there sould be the hole thing in the cell as code... A1 A1 - 0 input "14" in A1 A1 - 14 input "10" in A1 A1 - 24 input "-2" in A1 A1 - 22 at the end A1 = "14 + 10 - 2 " = 22 so that u can controll what is typed in kind regards mario |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Display number only if entered in a cell | Excel Worksheet Functions | |||
Excel - in a row of numbers, put last entered number Cell B2 | Excel Discussion (Misc queries) | |||
Number entered in cell getting always divided by 100 ! | Setting up and Configuration of Excel | |||
Number entered isn't number recorded in cell. | Excel Discussion (Misc queries) | |||
cell that only a certain number may be entered | Excel Worksheet Functions |