随笔分类 -  Execl Vba

摘要:'验证数据是否有效性 Function IsValidationData(ByVal Target As Range, columnNuber As Integer) On Error GoTo Line If Sheets("Sheet1").Cells(Target.Row, columnNub 阅读全文
posted @ 2021-01-26 15:09 蜗牛的礼物 阅读(138) 评论(0) 推荐(0) 编辑
摘要:使用Byte存储后转成string输出 '二分之一 Dim towSecondByte(1) As Byte, towSecondStr As String towSecondByte(0) = 189 towSecondByte(1) = 0 towSecondStr = towSecondByt 阅读全文
posted @ 2021-01-20 11:47 蜗牛的礼物 阅读(466) 评论(0) 推荐(0) 编辑
摘要:Dim BrandStr As String '获取品牌名称 BrandStr = Sheets("Sheet1").Cells(Target.Row, 2).Value '根据产品名称条件设置行 Select Case BrandStr Case "Time and Tru 普楦" If Shee 阅读全文
posted @ 2021-01-19 15:00 蜗牛的礼物 阅读(378) 评论(0) 推荐(0) 编辑
摘要:'Execl打开执行 Private Sub Workbook_Open() Dim selectStr As String Dim selectCellNum As Integer '获取Sheet2的A列有效行数 selectCellNum = Sheets("Sheet2").[A65536] 阅读全文
posted @ 2021-01-18 16:40 蜗牛的礼物 阅读(138) 评论(0) 推荐(0) 编辑
摘要:Private Sub Worksheet_Change(ByVal Target As Range) Dim str As String str = Cells(1, Target.Column).Value If (str = "订单编号") Then Application.EnableEve 阅读全文
posted @ 2020-12-22 14:29 蜗牛的礼物 阅读(666) 评论(0) 推荐(0) 编辑
摘要: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. 阅读全文
posted @ 2020-12-20 22:15 蜗牛的礼物 阅读(75) 评论(0) 推荐(0) 编辑