Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF, Case, or something else
I have a report generated from a program exported into excel upon completion.
When that workbook opens (only using one worksheet named Data), I want to have the values in column N (Teams) populate based on values in the same row in column A (Employee). Essentially I have 30 employees broken up into 7 teams. Since I need to have Column A look at up to 30 values to return column N values, should I run an If Then or Case, or something else entirely? My Excel and VBA is very rusty. Need help with correct commands and basic structure, please. Code I have now is: Private Sub Workbook_Open() If Range("$a2").Value = "Emp1" Then Range("$n2").Value = "TeamA" ElseIf Range("$a2").Value = "Emp2" Then Range("$n2").Value = "TeamB" ElseIf Range("$a2").Value = "Emp3" Then Range("$n2").Value = "TeamB" ElseIf Range("$a2").Value = "" Then Range("$n2").Value = "" Else: Range("$n2").Value = "No Team" End If End Sub Code works for row 2 but then stops. I've tried using both absolute and relative referencing to no avail. Any help is appreciated |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
change data of entire column from small case to upper case | Excel Worksheet Functions | |||
Changing multiple cell text from lower case to upper case | Excel Discussion (Misc queries) | |||
How to change mixed case to upper case in Excel for all cells | Excel Discussion (Misc queries) | |||
Change the text from lower case to upper case in an Excel work boo | Excel Discussion (Misc queries) | |||
How do I change a column in Excel from upper case to lower case? | Excel Worksheet Functions |