zoukankan      html  css  js  c++  java
  • How to create a dynamic range source(转) Anny

    Refer to http://www.contextures.com/xlDataVal05.html

    Refer to http://www.mrexcel.com/forum/excel-questions/188444-auto-increment-source-range-drop-down-list-box.html

    One way is to define a 'Dynamic' named range via insert/name/define and use a formula like this instead of a cell reference. The range will then accomodate additions. Mustn't include blank cells or have anything else in the column though. This starts at cell A1 using column A.
    = OFFSET(Mysheet!$A$1,0,0,COUNTA(Mysheet!$A:$A),1)

    1. Create and save a workbook (MyLists.xls, in this example)

    2. Enter a list of names in cells A1:A2 on Sheet 1.

    3. To create a dynamic range, choose Insert|Name|Define(or Formulas|Name Manager|)

    4. Use Employees as the range name, and the following formula: =OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),1)

    5. In another sheet, in one cell, choose Data|Data Validation|Allow List, and source: =Employees   (Note: Please donot forget =), and click OK

    PS:

    =OFFSET function:

    Returns a reference to a range that is a specified number of rows and columns from a cell or range of cells. The reference that is returned can be a single cell or a range of cells. You can specify the number of rows and the number of columns to be returned.

    Syntax

    OFFSET(reference, rows, cols, [height], [width])

    The OFFSET function syntax has the following arguments (argument: A value that provides information to an action, an event, a method, a property, a function, or a procedure.):

    • Reference Required. The reference from which you want to base the offset. Reference must refer to a cell or range of adjacent cells; otherwise, OFFSET returns the #VALUE! error value.
    • Rows Required. The number of rows, up or down, that you want the upper-left cell to refer to. Using 5 as the rows argument specifies that the upper-left cell in the reference is five rows below reference. Rows can be positive (which means below the starting reference) or negative (which means above the starting reference).
    • Cols Required. The number of columns, to the left or right, that you want the upper-left cell of the result to refer to. Using 5 as the cols argument specifies that the upper-left cell in the reference is five columns to the right of reference. Cols can be positive (which means to the right of the starting reference) or negative (which means to the left of the starting reference).
    • Height Optional. The height, in number of rows, that you want the returned reference to be. Height must be a positive number.
    • Width Optional. The width, in number of columns, that you want the returned reference to be. Width must be a positive number.

    =COUNTA function:

    The Excel Counta function returns a count of non-blanks within a supplied set of cells or values.

    The function is commonly used to return the number of non-blank cells in a range. However, as well as ranges of cells, the Counta function can directly received arrays of values, which are not stored in cells.

    COUNTA( value1, [value2], ... )

    Where the arguments, value1, [value2], etc, can be any values or references to cell ranges.

  • 相关阅读:
    python--向钉钉群发送消息(亲测可用)
    python--注册钉钉回调事件(亲测可用)
    Gradle
    SpringBoot 中thymeleaf模板引擎的使用
    SpringBoot对静态资源的映射规则
    SpringBoot的日志使用
    rsync实现文件同步
    python学习: 优秀Python学习资源收集汇总--转
    Python高级特性: 12步轻松搞定Python装饰器
    Python常见问题
  • 原文地址:https://www.cnblogs.com/limei/p/2860467.html
Copyright © 2011-2022 走看看