Search Bars(一个)

本文介绍了SearchBar组件,一种用于快速在大型集合中搜索值的界面元素,并探讨了与其配套使用的ScopeBar如何帮助用户定义搜索范围。文章还提到了SearchBar在UIKit中的实现方式。
A search bar provides an interface for text-based searches with a text box and buttons such as search and cancel. A search bar accepts text from users, which can be used as input for a search (shown here with placeholder text). A scope bar, which is available only in conjunction with a search bar—allows users to define the scope of a search (shown here below a search bar).

search bar提供了一个带有搜索、取消button以及文本框的基于文本搜索的界面。search bar接收用户输入的文本。用这些文本来作为搜索条件进行搜索(在这里显示为占位符)。

scope bar。它仅仅能连同search bar一起显示,同意用户定义搜索范围(以下显示就是一个search bar)。



Purpose. Search bars allow users to:

  • Quickly find a value in a large collection
  • 在一个大的集合里面高速查找某个值
  • Create a scope filter
  • 创建一个范围过滤器
Implementation. Search bars are implemented in the UISearchBar class and discussed in the UISearchBar Class Reference.
’ 插入E列公式(LSL下限) Sub InsertEFormula() Dim rowNum As Integer rowNum = ActiveCell.Row Dim formula As String ' 生成E列公式(关键修正:双引号转义括号匹配) formula = "=IF(ISNUMBER(SEARCH(""%"" , D" & rowNum & ")), " & _ "C" & rowNum & " - (C" & rowNum & "*VALUE(SUBSTITUTE(D" & rowNum & ", ""%"", """") / 100), " & _ "IF(ISNUMBER(SEARCH(""/"" , D" & rowNum & ")), " & _ "C" & rowNum & " + VALUE(MID(D" & rowNum & ", FIND(""/"", D" & rowNum & ") + 1, LEN(D" & rowNum & "))), " & _ "C" & rowNum & " - D" & rowNum & "))" ActiveCell.Formula = formula End Sub ’ 插入F列公式(USL上限) Sub InsertFFormula() Dim rowNum As Integer rowNum = ActiveCell.Row Dim formula As String ' 生成F列公式(关键修正:双引号转义括号匹配) formula = "=IF(ISNUMBER(SEARCH(""%"" , D" & rowNum & ")), " & _ "C" & rowNum & " + (C" & rowNum & "*VALUE(SUBSTITUTE(D" & rowNum & ", ""%"", """") / 100), " & _ "IF(ISNUMBER(SEARCH(""/"" , D" & rowNum & ")), " & _ "C" & rowNum & " + VALUE(LEFT(D" & rowNum & ", FIND(""/"", D" & rowNum & ") - 1)), " & _ "C" & rowNum & " + D" & rowNum & "))" ActiveCell.Formula = formula End Sub ’ 插入G列公式(Spec显示) Sub InsertGFormula() Dim rowNum As Integer rowNum = ActiveCell.Row Dim formula As String ' 生成G列公式(关键修正:双引号转义) formula = "=IF(ISNUMBER(SEARCH(""%"" , D" & rowNum & ")), " & _ "C" & rowNum & " & ""±"" & D" & rowNum & ", " & _ "IF(ISNUMBER(SEARCH(""/"" , D" & rowNum & ")), " & _ "C" & rowNum & " & LEFT(D" & rowNum & ", FIND(""/"", D" & rowNum & ") - 1) & ""/-"" & MID(D" & rowNum & ", FIND(""/"", D" & rowNum & ") + 1, LEN(D" & rowNum & ")), " & _ "C" & rowNum & " & ""+/-"" & D" & rowNum & "))" ActiveCell.Formula = formula End Sub ’ 创建自定义菜单 Sub Auto_Open() On Error Resume Next Application.CommandBars(“Worksheet Menu Bar”).Controls(“公式工具”).Delete On Error GoTo 0 With Application.CommandBars("Worksheet Menu Bar").Controls.Add(Type:=msoControlPopup) .Caption = "公式工具" With .Controls.Add(Type:=msoControlButton) .Caption = "插入E列公式" .OnAction = "InsertEFormula" End With With .Controls.Add(Type:=msoControlButton) .Caption = "插入F列公式" .OnAction = "InsertFFormula" End With With .Controls.Add(Type:=msoControlButton) .Caption = "插入G列公式" .OnAction = "InsertGFormula" End With End With End Sub以这个代码来补充缺少的括号双引号,其他任何内容不变
03-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值