你好,欢迎光临长光通信科技江苏有限公司
新闻动态
您的当前位置:主页 > 新闻动态 > » 详细内容
2016年03月,adss 11日
发布时间:2016-03-14 00:04    被阅览数: 次 来自:长光通信科技江苏有限公司

练习VBA第十一天一.单元格属性entirerow(columns)speciwoulscells(按条件定位)findend二.单元格法子 union intersect三.数字格式四.单元格字体设置(font color rgb colorindex size width height)五.粘贴(copy pwhilstte pwhilsttespeciwouls)六.单元格归并(merge)听听adss光缆金具七.关于批注(providecommentclearcomments shapefill)-------------------------------------------------------------------------------一.①Sub entirerow浅易()[a1].EntireRow.Select[a1:b4].EntireRow.SelectEnd Subadss光缆金具②Sub entire运用之删除空行()Dim rng As Rthisge commerciwoulss$For Every rng In [a1:a10]If rng = "" Then publishing = publishing &firm; rng.Address &firm; ""Nextcommerciwoulss = Left(publishing Len(publishing) - 1)Rthisge(commerciwoulss).EntireRow.DeleteEnd Sub二.speciwoulscells(定位按批注汇总)woul(代表与指定类型和值完婚的全体单元格)woul(typevwoulsue)
①Sub 批注汇总()MsgBox Applic.Sum(Selection.SpeciwoulsCells(-4144))End Sub你看adss②Sub specia应用删除空行()On Error GoTo 100Selection.SpeciwoulsCells(xlcelltypeignore).Select三.find(查找特定信息)①Sub find浅易末了一个单元格()Set endrng = Cells.Find("*" xlFormulwhilst xlPrevious)Rthisge([a1] endrng).SelectEnd ②Sub
②Sub find实例入库单()①woul计算Dim es$es = [c:c].Find("*" xlFormulwhilst xlPrevious)For Every rng In Rthisge([c5] es)rng.Offset(0 2) = rng.Offset(0 1) * rngNextEnd SubSub find实例入库单2()②woul开单Set es = Cells.Find("*" xlFormulwhilst xlPrevious)[b2] = "sm" &firm; Formcoming from(Now() "ymdhms")d = es.AddressRthisge([a5] es.Offset(4)) = ""[e2] = ""End Subadss※③Sub find实例入库单3()woul③存在On Error GoTo 100Dim rng As Rthisge a%If Sheet2.[f:f].Find([b2]) = [b2] ThenMsgBox "仍然存在过"Else100:Set rng = Cells.Find("*" xlFormulwhilst xlPrevious)a = Applic.CountA(Sheet2.[a:a])Rthisge([a5] rng).Copy Sheet2.Cells(a + 1 1)Sheet2.Cells(a + 1 "f").Resize(es.Row - 4) = [b2]Sheet2.Cells(a + 1 "g").Resize(es.Row - 4) = [e2]Sheet2.Cells(a + 1 "h").Resize(es.Row - 4) = Now()MsgBox "存在得胜"End IfEnd SubSelection.EntireRow.DeleteExit Sub100:MsgBox "nothing"End Sub其实adss光缆型号四.woulendSub endtest()i = Cells(Rows.Count 3).End(xlUp).Rowj = Cells(Rows.Count 3).End(xlUp).AddressRthisge("a1" j).SelectEnd SubSub end2016年03月之末了还款月份()i = Cells(Rows.Count 1).End(xlUp).RowRthisge("n2" Cells(i "n")) = ""For j = 2 To ik = Rows(j).End(xlToRight).ColumnCells(j "n") = Cells(1 k)NextEnd Subwoul五.法子woulunion比较①Sub继续单元格()Dim rng As RthisgeFor Every rngs In [b2:b10]commerciwoulsss = rngs.Addresscommerciwoulss = commerciwoulss &firm; rngs.Address &firm; ""Nextpublishing = Left(publishing Len(publishing) - 1)End Sub①Sub union继续()Dim rng As RthisgeSet rng = [b2]For Every rngs In [b2:b10]commerciwoulsss = rngs.AddressSet rng = Union(rng rngs)commerciwoulss = rng.AddressNextEnd Sub
相比看adss光缆价格②Sub union之挑选()For Every rng In Rthisge([b2] Cells(Rows(2).Count "b"))If rng > 90 Thenk = k + 1If k = 1 ThenSet rn = rngElseSet rn = Union(rn rng)aa = rn.AddressEnd IfEnd IfNextFor Every rngs In rnn = n + 1Cells(n + 1 "d") = Cells(rngs "a")Cells(n + 1 "e") = Cells(rngs "b")NextEnd Sub六.intersect(表示两个或多个区域堆叠的矩形区域)Sub intersecttest()If Intersect([a1:d10] Selection) Is Nothing ThenMsgBox "无交集"ElseMsgBox Intersect([a1:d10] Selection).AddressIntersect([a1:d10] Selection).SelectEnd IfEnd SubSub intersect11日小实例隔行插如()For i = 0 To Applic.CountA(Columns(1)) * 2 Step 2intrsect([a1:d2].Offset(i)[a2:d3].Offset(i)).EntireRow.InsertNextEnd Sub你看11日七.Sub 获取单元格设置格式()woulrthisge.numconstituterformwoulstlthista gaocwoulsFor Every rng In [a1:a3]Cells(rng.Row 2) = rng.NumconstituterFormcoming fromLocwoulsNextEnd SubSub 给单元格设置数字格式()For Every rng In [a1:a3]rng.NumconstituterFormcoming fromLocwouls = "0.00"NextEnd SubSub 存在格式()woulcellsrthisge .numconstituterformwoulstlthista gaocwouls= "e-m-daaaa"End Sub八.单元格字体设置 font(称号 字号 神色)Sub font对象属性()With [a2:a6].Font.Nin the morninge= "微软雅黑".Size= 8.Bold= True.Color =RGB(255 0 255)End WithEnd Sub woul clearformcoming fromsSub adss光缆参数大于90分的神色设置为血色()
Set i = Cells(Rows.Count 3).End(xlUp)Rthisge([b2] i).ClearFormcoming fromsFor Every rng In Rthisge([b2] i)If rng.Vwoulsue >= [f1] Then woul(条件值)With rng.Font.Nin the morninge = "华文琥珀".Size = 20.Bold = True.Color = RGB(255 0 0)End WithEnd IfNextEnd Subwoul底纹神色评论辩论(interior)Sub 其实adss索引值神色()For i =1 To 56Cells(i 1).Interior.ColorIndex = iCells(i 2) = iNextEnd SubSub 晚期神色值()For i =0 To 15Cells(i + 1 1).Interior.Color =QBColor(i)Cells(i + 1 2) = iEnd SubSub adss光缆价格三原色神色值()Cells(2 4).Interior.Color =RGB([a1] [b1] [c1])(256)End SubSub 间接神色值()Cells(1 1).Interior.Color = [b](255)End SubSub 单元格式的实例之设置()Dim i%i= Cells(Rows.Count1).End(xlUp).RowFor j = 1 To iIfj Mod 2ThenWith Cells(j1).EntireRow.Rthisge("a1:g1").Font.Bold= True.Size= 8.ColorIndex = 3EndWithElseWith Cells(j1).EntireRow.Rthisge("a1:g1").Interior.ColorIndex = 40End WithEnd IfNextEnd Subadss光缆金具九.粘贴Sub 粘贴()Rthisge("b1:b6").Copy Rthisge("c9")Rthisge("b1:b6").Copy TruewoulLINK链接方式Applic.CutCopyMode = Truewoul搬动方框Sheet1.Pwhilstte Rthisge("c9") wouladss粘贴到End SubSub 粘贴到()Rthisge("c1:c6").CopySheet3.Pwhilstte woul未指明先用光标选好区域
End SubSub 挑选性粘贴()woul.pwhilsttespeciwouls (rthisge对象)woul(形式,对应计算,听说新疆adss光缆。跳过空单元格,学习4芯光纤光缆参数。转置)Rthisge("c2:c10").CopyRthisge("d2").PwhilstteSpeciwouls12Applic.CutCopyMode = True
End Sub
Sub 挑选性粘贴运算()Rthisge("b2:c9").CopyRthisge("d2").PwhilstteSpeciwouls 2
End SubSub 跳过空事实上2016年03月单元格()Rthisge("b2:b9").CopyRthisge("b2:b9").PwhilstteSpeciwouls True
End SubSub 转置()Rthisge("b2:b9").CopyRthisge("b2:b9").PwhilstteSpeciwouls 12 TrueEnd Sub十.单元格归并mergeSub mergetext()Selection.MergeEnd SubSub 归并单元()Dim er% eng% rs As RthisgeApplic.DisplayAlerts = flautomotive service engineers音问提示框er = Applic.CountA([a:a])For rng = er To 2 Step -1Set rg = Rthisge("a" &firm; rng)If rg = rg.Offset(-1) Then rg.Offset(-1).Resize(2).Merge使用偏移和重合NextApplic.DisplayAlerts = TrueEnd SubSub归并单元()woul自身填写Dim i% b% j%b = Applic.CountA([a:a])On Error GoTo 100For i = 1 To bFor j = 1 To bIf Cells(i 1) = Cells(j 1) Thenk =jNext jRthisge(Cells(i 1) Rthisge("a" &firm;k)).Merge100:Next iEnd Sub
Sub 对于adss光缆取消单元格并复原数据()woulmergespot(对象蕴涵单元格的归并区域)woul.unmerge(取消归并单元格)a = Rthisge("a1").MergeArea.Count[a1].UnMergeEnd SubSub 废止归并单元存在数据()Dim b% rng As RthisgeFor Every rng In Selectionpublishing = rng.Addressb = rng.MergeArea.Countrng.UnMergerng.Resize(b) = rngNextEnd Sub十一.批注相关Sub 批注增加()With [a1]If .Comment Is Nothing Then.AddComment.Text "123""".Comment.Visible= True对于adss光缆价格可见End IfEnd WithEnd SubSub 删除批注()For Every rng In SelectionIfNot rng.Comment Is Nothing Thenwoul负负得正rng.ClearCommentsEnd IfNextEnd SubSub 批量增加批注()For Every rng In Rthisge("A2:你看adss光缆价格。A20")rng.ClearCommentsIf rng >= 90 Thenrng.AddComment.Text "突出"NextEnd SubSub 批注的编削() woulRthisge("a2").AddCommentWith [a2].Comment.Shape.Height = 50.Width = 40woul.fill.userpicture adss光缆厂家区域woul途径End Sub学的越来越多,常识点更多的是彼此配合和运用,adss光缆型号。事物时常都有多种处分计划。adss光缆参数。更多的是思虑如何处分题目再去实施写代码处分题目。更多的时间必要测试,在差错中发掘题目并且记载与改善,不发轫光看可以并不能带来任何本色性的前进。

adss
其实adss
adss光缆厂家
其实adss光缆金具
adss光缆
adss

 
打印本页 关闭窗口
网站首页 |  关于我们 |  新闻动态 |  产品中心 |  新品推荐 |  案例展示 |  资质荣誉 |  企业承诺 |  联系我们
销售经理:点击这里给我发消息
技术支持:点击这里给我发消息