Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Is it possible that when we enter a number in a cell, the same cell should
display the entered number after deducting certain percentage. This macro should run automatically when the excel file is open -- Life isa journey not a destination |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Put this event macro in the worksheet code area:
Private Sub Worksheet_Change(ByVal Target As Range) Dim r As Range Set r = Range("B9") If Intersect(r, Target) Is Nothing Then Exit Sub Application.EnableEvents = False r.Value = 0.75 * r.Value Application.EnableEvents = True End Sub If you enter a value in cell B9, it will automatically be reduced to 75% of the typed value. Because it is worksheet code, it is very easy to install and use: 1. right-click the tab name near the bottom of the window 2. select View Code - this brings up a VBE window 3. paste the stuff in and close the VBE window If you save the workbook, the macro will be saved with it. To remove the macro: 1. bring up the VBE windows as above 2. clear the code out 3. close the VBE window To learn more about macros in general, see: http://www.mvps.org/dmcritchie/excel/getstarted.htm To learn more about Event Macros (worksheet code), see: http://www.mvps.org/dmcritchie/excel/event.htm -- Gary''s Student - gsnu200909 "Sherees" wrote: Is it possible that when we enter a number in a cell, the same cell should display the entered number after deducting certain percentage. This macro should run automatically when the excel file is open -- Life isa journey not a destination |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Many thanks for ur answer
what if i want to change B1:B700(but want to leave one cell for sum total in every 8 cells down), similarly in C1:C700, & D1: D700 -- Life isa journey not a destination "Gary''s Student" wrote: Put this event macro in the worksheet code area: Private Sub Worksheet_Change(ByVal Target As Range) Dim r As Range Set r = Range("B9") If Intersect(r, Target) Is Nothing Then Exit Sub Application.EnableEvents = False r.Value = 0.75 * r.Value Application.EnableEvents = True End Sub If you enter a value in cell B9, it will automatically be reduced to 75% of the typed value. Because it is worksheet code, it is very easy to install and use: 1. right-click the tab name near the bottom of the window 2. select View Code - this brings up a VBE window 3. paste the stuff in and close the VBE window If you save the workbook, the macro will be saved with it. To remove the macro: 1. bring up the VBE windows as above 2. clear the code out 3. close the VBE window To learn more about macros in general, see: http://www.mvps.org/dmcritchie/excel/getstarted.htm To learn more about Event Macros (worksheet code), see: http://www.mvps.org/dmcritchie/excel/event.htm -- Gary''s Student - gsnu200909 "Sherees" wrote: Is it possible that when we enter a number in a cell, the same cell should display the entered number after deducting certain percentage. This macro should run automatically when the excel file is open -- Life isa journey not a destination |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Enter date and time in cell | Excel Discussion (Misc queries) | |||
enter a static time dependent upon another cell value | Excel Discussion (Misc queries) | |||
when i enter time in cell it changed, why? | Excel Worksheet Functions | |||
enter a time into a cell, have the cell show two times the entry | Excel Worksheet Functions | |||
How do I enter a time formula into a worksheet that determines if. | Excel Discussion (Misc queries) |