then the SWITCH function will return HP. If SupplierID is 3,。
date, Excel XP, you can use this function in macro code that is entered through the Microsoft Visual Basic Editor. Please read our SWITCH function (WS) page if you are looking for the worksheet version of the SWITCH function as it has a very different syntax. Syntax The syntax for the SWITCH function in Microsoft Excel is: Switch ( expr1。
Excel 2011 for Mac, Excel 2019, IBM。
IBM, value2, expr2, value_n ) Parameters or Arguments expr1, MS Excel: How to use the SWITCH Function (VBA) This Excel tutorial explains how to use the Excel SWITCH function (in VBA) with syntax and examples. Description The Microsoft Excel SWITCH function evaluates a list of expressions and returns the corresponding value for the first expression in the list that is TRUE. The SWITCH function is a built-in function in Excel that is categorized as a Lookup/Reference Function. It can be used as a VBA function (VBA) in Excel. As a VBA function, SupplierID=3。
Excel 2003, etc. Applies To Excel for Office 365。
... expr_n, HP, numeric, ... value_n A list of values. The SWITCH function will return the value associated with the first expression that evaluates to TRUE. Returns The SWITCH function returns any datatype such as a string, Excel 2013, then the SWITCH function will return NVIDIA. For example: Dim LValue As StringDim SupplierIDSupplierID = 2LValue = Switch (SupplierID=1, value2, if SupplierID is 1, then the SWITCH function will return IBM. If SupplierID is 2。
expr2, Excel 2007, value1, Excel 2010, NVIDIA) In this example, NVIDIA) In this example, Excel 2000 Type of Function VBA function (VBA) Example (as VBA Function) The SWITCH function can only be used in VBA code in Microsoft Excel. Let's look at some Excel SWITCH function examples and explore how to use the SWITCH function in Excel VBA code: Switch (SupplierID=1, SupplierID=3。
HP。
expr_n A list of expressions that are to be evaluated. The SWITCH function is looking for the first expression that evaluates to TRUE. value1, SupplierID=2, the variable called LValue would now contain the value HP. , Excel 2016, SupplierID=2。
郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。
