随笔分类 - Execl Vba
摘要:'验证数据是否有效性 Function IsValidationData(ByVal Target As Range, columnNuber As Integer) On Error GoTo Line If Sheets("Sheet1").Cells(Target.Row, columnNub
阅读全文
摘要:使用Byte存储后转成string输出 '二分之一 Dim towSecondByte(1) As Byte, towSecondStr As String towSecondByte(0) = 189 towSecondByte(1) = 0 towSecondStr = towSecondByt
阅读全文
摘要:Dim BrandStr As String '获取品牌名称 BrandStr = Sheets("Sheet1").Cells(Target.Row, 2).Value '根据产品名称条件设置行 Select Case BrandStr Case "Time and Tru 普楦" If Shee
阅读全文
摘要:'Execl打开执行 Private Sub Workbook_Open() Dim selectStr As String Dim selectCellNum As Integer '获取Sheet2的A列有效行数 selectCellNum = Sheets("Sheet2").[A65536]
阅读全文
摘要:Private Sub Worksheet_Change(ByVal Target As Range) Dim str As String str = Cells(1, Target.Column).Value If (str = "订单编号") Then Application.EnableEve
阅读全文
摘要:1.For Each Sub TestHellow() Dim r As Range, i As Integer i = 1 For Each r In Range("A1:A100") r.Value = i i = i + 1 Next r MsgBox "完成!" End Sub 结果: 2.
阅读全文