ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Please Help!!! (https://www.excelbanter.com/excel-programming/295657-please-help.html)

hbk

Please Help!!!
 
I made a box with values(e.g. N = No Work, 1 = New Ceiling Tile, 2 = New etc.). How do I write a function so that it will check all the values. The only thing I remember from school is else or elseif statements. Can you do those in Excel or is there just some way I'm naive to?

Ron de Bruin

Please Help!!!
 
Hi

Not sure I understand your question ?

You posted in programming so I give you a code example
Do you need that??

You can use the change event with Select Case

Here is a example that use the Change event of the worksheet
Right click on a sheet tab and choose view code.
Paste the event in there and press Alt-Q to go back to Excel.

This will only work in a1:a20

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("a1:a20"), Target) Is Nothing Then
Select Case Target.Value
Case "N"
Target.Value = "No Work"
Case 1
Target.Value = "New Ceiling Tile"
Case 2
Target.Value = "New ...."
End Select
End If
End Sub

--
Regards Ron de Bruin
http://www.rondebruin.nl


"hbk" wrote in message ...
I made a box with values(e.g. N = No Work, 1 = New Ceiling Tile, 2 = New etc.). How do I write a function so that it will check

all the values. The only thing I remember from school is else or elseif statements. Can you do those in Excel or is there just
some way I'm naive to?




All times are GMT +1. The time now is 12:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com