Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Whilst the other two suggestions should work, a far simpler change is this
Sub Raul() Dim strField As String strField = "AP_Parts" Call Test(strField) MsgBox (strField) End Sub -- HTH Bob "Michael Arch" wrote in message ... This function should return the new string, but it returns Blank can anyone explain why, and also tell me how to fix it and avoid similar issues in the future. I tried using Select Case statement in my first attempt and it did not work, so I figure I switch to If statements, but the result is the same a blank. Thanks in advance Global strField As String Sub Raul() strField = "AP_Parts" strField = Test(strField) MsgBox (strField) End Sub Function Test(strField As String) As String Dim FndException strmval = UCase(strField) If strmval = "NV_EQUIPMENT" Then strField = "HIST_Dir" Else If strmval = "NV_PARTS" Then strField = "HIST_Dir_Prt" Else If strmval = "AP_EQUIPMENT" Then strField = "HIST_Dis" Else If strmval = "AP_PARTS" Then strField = "HIST_Dis_Prt" Else If strmval = "GPL_EQUIPMENT" Then strField = "HIST_Dis" Else If strmval = "STL_COMMON" Then strField = "HIST_OTH" End If End If End If End If End If End If End Function Michael Arch. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Calculate working days but change working week | Excel Discussion (Misc queries) | |||
Making weekend days working days - the system cuts the working tim | Excel Discussion (Misc queries) | |||
Newly created Get Function is not working when I copied the syntax from a working function | Excel Programming | |||
Macro working in Excel 2003; not working in Excel 2000 | Excel Programming | |||
Adding sales from a non working day to the previous working day | Excel Programming |