Excel Formula Help Required.
Solved/Closed
Related:
- Excel Formula Help Required.
- Number to words in excel formula - Guide
- Excel grade formula - Guide
- Date formula in excel dd/mm/yyyy - Guide
- Logitech formula vibration feedback wheel driver - Download - Drivers
- Excel mod apk for pc - Download - Spreadsheets
1 response
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Oct 23, 2010 at 10:46 PM
Oct 23, 2010 at 10:46 PM
the operative cell where you want to enter the number is A1
in D1 to D5 enter those predetermined five numbers
2.4
3
3.6
4.2
4.8
right click the sheet tab and click view code
in the window that comes up
copy this EVENT CODE for this sheet
now type any number in A1 see what happens in A1
if the number is more than 4.8 nothing will happen
if the operative cell is not A1 you have change A1 in the sub to that cell address in all cases. for this purpose keep the cursor on the top of the event code and click control+H. in the "find what" type A1
under "replace with" type the operative cell address
ciick "replace all" in the bottom .
in D1 to D5 enter those predetermined five numbers
2.4
3
3.6
4.2
4.8
right click the sheet tab and click view code
in the window that comes up
copy this EVENT CODE for this sheet
Private Sub Worksheet_Change(ByVal Target As Range) Dim x As Double, cfind As Range, r As Range, c As Range Application.EnableEvents = False On Error GoTo line1 If Target.Address <> "$A$1" Then goto line1 x = Target.Value If Target.Value > Range("D1").End(xlDown) Then GoTo line1 Set r = Range("D1:D5") Set cfind = r.Cells.Find(what:=x, lookat:=xlWhole) If cfind Is Nothing Then For Each c In r If c > x Then Range("a1") = c GoTo line1 End If Next c End If line1: Application.EnableEvents = True End Sub
now type any number in A1 see what happens in A1
if the number is more than 4.8 nothing will happen
if the operative cell is not A1 you have change A1 in the sub to that cell address in all cases. for this purpose keep the cursor on the top of the event code and click control+H. in the "find what" type A1
under "replace with" type the operative cell address
ciick "replace all" in the bottom .
Oct 24, 2010 at 07:03 AM