没有合适的资源?快使用搜索试试~ 我知道了~
Excel VBA , Excel 编程。 等等
资源推荐
资源详情
资源评论
Option Explicit
Sub Workbook()
Dim str, str2, str3, str4, m, n As String 'str is 部品CODE: value--str2 is 名称: value-- str3 is 型号: value-- str4 is 数量: value
Dim i, j, h, k, x, o As Integer
For o = 6 To Range("A65536").End(xlUp).Row
Range(Cells(o, 16), Cells(Range("A65536").End(xlUp).Row, 16)).Select 'select Column of P form 6 to End
str4 = ActiveSheet.Cells(o, 16).Value '数量: value
If (str4 = "") Then
Debug.Print ("number is null")
Else
'Debug.Print ("number is not null")
str = ActiveSheet.Cells(o, 1).Value '部品CODE:
str2 = ActiveSheet.Cells(o, 3).Value '名称: value
str3 = ActiveSheet.Cells(o, 4).Value '型号: value
End If
Dim FN As String
Dim ShtName As String
FN = ThisWorkbook.Path & "\棚カード.XLS"
If Len(Dir(FN)) = 0 Then
MsgBox "Can not find file" & vbCrLf & FN, vbExclamation, "Error"
Else
Workbooks.Open Filename:=ThisWorkbook.Path & "\棚カード.XLS" 'open 棚カード.XLS
If ShIsBlank(ActiveSheet) = False And ShIsBlank2(ActiveSheet) = True And str4 <> "" Then
ActiveSheet.Cells(23, 2).Value = str
ActiveSheet.Cells(24, 2).Value = str3
ActiveSheet.Cells(25, 2).Value = str4
ActiveSheet.Cells(24, 5).Value = str2
ElseIf str4 = "" And ShIsBlank2(ActiveSheet) = True Then
ActiveSheet.Cells(23, 2).Value = ""
Sub Workbook()
Dim str, str2, str3, str4, m, n As String 'str is 部品CODE: value--str2 is 名称: value-- str3 is 型号: value-- str4 is 数量: value
Dim i, j, h, k, x, o As Integer
For o = 6 To Range("A65536").End(xlUp).Row
Range(Cells(o, 16), Cells(Range("A65536").End(xlUp).Row, 16)).Select 'select Column of P form 6 to End
str4 = ActiveSheet.Cells(o, 16).Value '数量: value
If (str4 = "") Then
Debug.Print ("number is null")
Else
'Debug.Print ("number is not null")
str = ActiveSheet.Cells(o, 1).Value '部品CODE:
str2 = ActiveSheet.Cells(o, 3).Value '名称: value
str3 = ActiveSheet.Cells(o, 4).Value '型号: value
End If
Dim FN As String
Dim ShtName As String
FN = ThisWorkbook.Path & "\棚カード.XLS"
If Len(Dir(FN)) = 0 Then
MsgBox "Can not find file" & vbCrLf & FN, vbExclamation, "Error"
Else
Workbooks.Open Filename:=ThisWorkbook.Path & "\棚カード.XLS" 'open 棚カード.XLS
If ShIsBlank(ActiveSheet) = False And ShIsBlank2(ActiveSheet) = True And str4 <> "" Then
ActiveSheet.Cells(23, 2).Value = str
ActiveSheet.Cells(24, 2).Value = str3
ActiveSheet.Cells(25, 2).Value = str4
ActiveSheet.Cells(24, 5).Value = str2
ElseIf str4 = "" And ShIsBlank2(ActiveSheet) = True Then
ActiveSheet.Cells(23, 2).Value = ""
资源评论
xiaowei_675658913
- 粉丝: 0
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功