媒体资源管理系统源程序.docx
Sub tianjia_zz()If Sheets("郑州上画").Cells(2, 1).Value = 0 ThenMsgBox ("无添加项")Exit SubElseEnd IfDim x, y, n, m, l As LongSheets("郑州").Cells(1, 18) = "=counta(郑州上画!a:a)"For n = 2 To Sheets("郑州").Cells(1, 18) + 1If Sheets("郑州上画").Cells(n, 1).Value = "" ThenMsgBox ("添加成功")Exit SubElseEnd IfFor x = 4 To 600y = 7If Sheets("郑州").Cells(x, 2) = Sheets("郑州上画").Cells(n, 1) Thenl = 0For m = 7 To 12If Sheets("郑州").Cells(x, m) = Sheets("郑州上画").Cells(1, 7) And Sheets("郑州上画").Cells(1, 7).Value <> 0 Thenl = l + 1ElseEnd IfNext mIf l = 0 ThenDo Until (IsEmpty(Sheets("郑州").Cells(x, y).Value)y = y + 1LoopIf Sheets("郑州").Cells(x, 16) <> "断电" And Sheets("郑州").Cells(x, 13) <> 0 ThenSheets("郑州").Cells(x, y) = Sheets("郑州上画").Cells(1, 7)Sheets("郑州上画").Cells(n, 6) = "可上"ElseIf Sheets("郑州").Cells(x, 16) = "断电" And Sheets("郑州").Cells(x, 13) = 6 ThenSheets("郑州").Cells(x, y) = Sheets("郑州上画").Cells(1, 7)Sheets("郑州上画").Cells(n, 6) = "可上"ElseSheets("郑州上画").Cells(n, 6) = "不可用"Sheets("郑州上画").Cells(n, 7) = Sheets("郑州").Cells(x, 7)Sheets("郑州上画").Cells(n, 8) = Sheets("郑州").Cells(x, 8)Sheets("郑州上画").Cells(n, 9) = Sheets("郑州").Cells(x, 9)Sheets("郑州上画").Cells(n, 10) = Sheets("郑州").Cells(x, 10)Sheets("郑州上画").Cells(n, 11) = Sheets("郑州").Cells(x, 11)Sheets("郑州上画").Cells(n, 12) = Sheets("郑州").Cells(x, 12)End IfElseSheets("郑州上画").Cells(n, 6) = "与原选点位重复,请重新选择!"End IfElseEnd IfNext xNext nEnd SubSub tianjia_qz()If Sheets("郑州上画").Cells(2, 1).Value = 0 ThenMsgBox ("无添加项")Exit SubElseEnd IfDim x, y, n, m, l As LongSheets("郑州").Cells(1, 18) = "=counta(郑州上画!a:a)"For n = 2 To Sheets("郑州").Cells(1, 18) + 1If Sheets("郑州上画").Cells(n, 1).Value = "" ThenMsgBox ("添加成功")Exit SubElseEnd IfFor x = 4 To 600If Sheets("郑州").Cells(x, 2) = Sheets("郑州上画").Cells(n, 1) ThenSheets("郑州").Cells(x, 17) = Sheets("郑州上画").Cells(1, 7)ElseEnd IfNext xNext nEnd SubSub tianjia_dd()If Sheets("郑州上画").Cells(2, 1).Value = "" ThenMsgBox ("无添加项")Exit SubElseEnd IfDim x, y, n As LongFor y = 3 To 1000Sheets("郑州").Cells(y, 16) = ""Next ySheets("郑州").Cells(1, 18) = "=counta(郑州上画!a:a)"n = 2For n = 2 To Sheets("郑州").Cells(1, 18) + 1If Sheets("郑州上画").Cells(n, 1).Value = "" ThenMsgBox ("添加成功")Exit SubElseEnd Ifx = 3Sheets("郑州").Cells(1, 18) = Sheets("郑州上画").Cells(n, 1)Do Until Sheets("郑州").Cells(x, 2) = Sheets("郑州").Cells(1, 18)x = x + 1LoopSheets("郑州").Cells(x, 16) = "断电"Next nEnd SubSub tianjia_zx()Dim x, n As Longn = 2For x = 4 To 1000If Sheets("郑州").Cells(x, 13) <> 0 And Sheets("郑州").Cells(x, 16) <> "断电" ThenSheets("郑州上画").Cells(n, 1) = Sheets("郑州").Cells(x, 2)If Sheets("郑州").Cells(x, 15) <> "无超链接" ThenSheets("郑州上画").SelectSheets("郑州上画").Hyperlinks.Add anchor:=Sheets("郑州上画").Cells(n, 1), Address:=Sheets("郑州").Cells(x, 2).Hyperlinks(1).AddressEnd IfSheets("郑州上画").Cells(n, 2) = Sheets("郑州").Cells(x, 3)Sheets("郑州上画").Cells(n, 3) = Sheets("郑州").Cells(x, 4)Sheets("郑州上画").Cells(n, 4) = Sheets("郑州").Cells(x, 5)Sheets("郑州上画").Cells(n, 5) = Sheets("郑州").Cells(x, 6)Sheets("郑州上画").Cells(n, 6) = Sheets("郑州").Cells(x, 13)n = n + 1ElseEnd IfNext xIf Sheets("郑州").Cells(x, 2) = "" ThenMsgBox ("最新点位生成成功")Exit SubElseEnd IfEnd SubSub tianjia_QK()Sheets("郑州上画").Cells(1, 7) = ""Sheets("郑州上画").Range("A2:Q1000").ClearContentsMsgBox ("清除成功")End SubSub tianjia_zdsc()If Sheets("郑州上画").Cells(1, 7).Value = "" ThenMsgBox ("无指定客户")Exit SubElseEnd IfDim x, y, n, h As Longn = 0Sheets("郑州").Cells(1, 19) = "=counta(郑州!F:F)"For x = 4 To Sheets("郑州").Cells(1, 19) + 1For y = 7 To 12If Sheets("郑州").Cells(x, y) = Sheets("郑州上画").Cells(1, 7) ThenSheets("郑州").Cells(x, y) = ""n = n + 1ElseEnd IfNext yNext xMsgBox ("指定客户删除完毕,共删除" & n & "项")End SubSub tianjia_zdcz()If Sheets("郑州上画").Cells(1, 7).Value = "" ThenMsgBox ("无指定客户")Exit SubElseEnd IfDim x, y, n, h As Longn = 2Sheets("郑州").Cells(1, 18) = "=counta(郑州!F:F)"For x = 4 To Sheets("郑州").Cells(1, 18) + 1For y = 7 To 17If Sheets("郑州").Cells(x, y) = Sheets("郑州上画").Cells(1, 7) ThenSheets("郑州上画").Cells(n, 1) = Sheets("郑州").Cells(x, 2)Sheets("郑州上画").Cells(n, 2) = Sheets("郑州").Cells(x, 3)Sheets("郑州上画").Cells(n, 3) = Sheets("郑州").Cells(x, 4)Sheets("郑州上画").Cells(n, 4) = Sheets("郑州").Cells(x, 5)Sheets("郑州上画").Cells(n, 5) = Sheets("郑州").Cells(x, 6)Sheets("郑州上画").Cells(n, 6) = Sheets("郑州").Cells(x, 16)n = n + 1ElseEnd IfNext yNext xIf Sheets("郑州上画").Cells(2, 1).Value = "" ThenMsgBox ("查找不到指定客户")Exit SubElseMsgBox ("指定客户查找完毕,共查找到" & n - 2 & "项")Exit SubEnd IfEnd SubSub tianjia_zzbhhd()If Sheets("郑州上画").Cells(2, 1).Value = 0 ThenMsgBox ("无添加项")Exit SubElseEnd IfDim x, n As LongSheets("郑州").Cells(1, 18) = "=counta(郑州上画!a:a)"For n = 2 To Sheets("郑州").Cells(1, 18) + 1If Sheets("郑州上画").Cells(n, 1).Value = "" ThenMsgBox ("添加成功")Exit SubElseEnd IfFor x = 4 To 1000If Sheets("郑州").Cells(x, 2) = Sheets("郑州上画").Cells(n, 1) ThenSheets("郑州上画").Cells(n, 2) = Sheets("郑州").Cells(x, 3)Sheets("郑州上画").Cells(n, 3) = Sheets("郑州").Cells(x, 4)Sheets("郑州上画").Cells(n, 4) = Sheets("郑州").Cells(x, 5)Sheets("郑州上画").Cells(n, 5) = Sheets("郑州").Cells(x, 6)Sheets("郑州上画").Cells(n, 6) = Sheets("郑州").Cells(x, 7)Sheets("郑州上画").Cells(n, 7) = Sheets("郑州").Cells(x, 8)Sheets("郑州上画").Cells(n, 8) = Sheets("郑州").Cells(x, 9)Sheets("郑州上画").Cells(n, 9) = Sheets("郑州").Cells(x, 10)Sheets("郑州上画").Cells(n, 10) = Sheets("郑州").Cells(x, 11)Sheets("郑州上画").Cells(n, 11) = Sheets("郑州").Cells(x, 12)Sheets("郑州上画").Cells(n, 12) = Sheets("郑州").Cells(x, 16)ElseEnd IfNext xNext nEnd SubSub tianjia_zzxc()If Sheets("郑州上画").Cells(2, 1).Value = 0 ThenMsgBox ("无下撤点位")Exit SubElseEnd IfDim x, y, n, m, l As LongSheets("郑州").Cells(1, 18) = "=counta(郑州上画!a:a)"For n = 2 To Sheets("郑州").Cells(1, 18) + 1If Sheets("郑州上画").Cells(n, 1).Value = "" ThenMsgBox ("下撤完毕")Exit SubElseEnd IfFor x = 4 To 600If Sheets("郑州").Cells(x, 2) = Sheets("郑州上画").Cells(n, 1) Thenm = 0For y = 7 To 17If Sheets("郑州").Cells(x, y) = Sheets("郑州上画").Cells(1, 7) ThenSheets("郑州").Cells(x, y) = ""m = m + 1ElseEnd IfNext yIf m = 0 ThenSheets("郑州上画").Cells(n, 6) = "该点位无需要删除的客户"ElseEnd IfElseEnd IfNext xNext nEnd SubSub tianjia_zzbhhd1()If Sheets("郑州上画").Cells(2, 3).Value = 0 ThenMsgBox ("无添加项")Exit SubElseEnd IfDim x, n As LongSheets("郑州").Cells(1, 18) = "=counta(郑州上画!c:c)"For n = 2 To Sheets("郑州").Cells(1, 18) + 1If Sheets("郑州上画").Cells(n, 3).Value = "" ThenMsgBox ("添加成功")Exit SubElseEnd IfFor x = 4 To 1000If Sheets("郑州").Cells(x, 4) = Sheets("郑州上画").Cells(n, 3) ThenSheets("郑州上画").Cells(n, 1) = Sheets("郑州").Cells(x, 2)Sheets("郑州上画").Cells(n, 2) = Sheets("郑州").Cells(x, 3)Sheets("郑州上画").Cells(n, 4) = Sheets("郑州").Cells(x, 5)Sheets("郑州上画").Cells(n, 5) = Sheets("郑州").Cells(x, 6)ElseEnd IfNext xNext nEnd Sub