20170728xlVba还是这个混蛋
Public Sub Main22()
If Now() >= #1/1/2018# Then Exit Sub
Dim strText As String
Dim Reg As Object, Mh As Object, OneMh As Object
Dim i As Long Set Reg = CreateObject("Vbscript.Regexp")
With Reg
.MultiLine = True
.Global = True
.Ignorecase = False
'class='gray'>007</td><td class='red big'>78018</td>
' .Pattern = "(>)(\d{3})(?:</td><td class='red big'>)(\d{5})(?:</td>)"
'20170728013</td><td class='z_bg_13'>07627</td>
.Pattern = "(\d{11})(<)(?:/td><td class='z_bg_13'>)(\d{5})(?:</td>)" End With Dim Today As String, Yesterday As String Yesterday = Format(DateAdd("d", -1, Now()), "yyyy-mm-dd")
'Set xmlhttp = CreateObject("MSXML2.XMLHTTP")
'WinHttp.WinHttpRequest
With CreateObject("WinHttp.WinHttpRequest.5.1")
'.Open "GET", "http://chart.cp.360.cn/kaijiang/kaijiang?lotId=255401&spanType=2&span=" & Yesterday & "_" & Yesterday, False
.Open "GET", "http://zst.cjcp.com.cn/cjwssc/view/ssc_zusan-ssc-0-3-100.html", False
.Send strText = .responsetext
End With 'Debug.Print strText
'strText = JSEval(strText)
Set Mh = Reg.Execute(strText) With Sheets(1)
.Cells.Clear
.Range("A1:N1").Value = Array("大期号", "小期号", "万", "千", "百", "十", "个", "后三", "组01", "组23", "组45", "组67", "组89", "预测")
Index = 1
For Each OneMh In Mh
Index = Index + 1
.Cells(Index, 1).Value = "'" & OneMh.submatches(0)
.Cells(Index, 2).Value = "'" & Right(OneMh.submatches(0), 3)
op = OneMh.submatches(2)
For j = 1 To Len(op)
.Cells(Index, j + 2).Value = Mid(op, j, 1)
Next j
.Cells(Index, 8).Value = "'" & Right(op, 3)
Next OneMh For i = 2 To Index
s = .Cells(i, 8).Text
gua = 0
For j = 9 To 13
keys = Replace(.Cells(1, j).Text, "组", "")
key1 = Left(keys, 1)
key2 = Right(keys, 1)
'Debug.Print s; " "; keys
If InStr(1, s, key1) = 0 And InStr(1, s, key2) = 0 Then
.Cells(i, j).Value = "中"
Else
.Cells(i, j).Value = "挂"
gua = gua + 1
End If
Next j
If gua >= 3 Then
.Cells(i, 14).Value = "挂"
Else
.Cells(i, 14).Value = "中"
End If Next i With .UsedRange
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
End With SetBorders .UsedRange Dim uRng As Range
Dim OneCell As Range For Each OneCell In .UsedRange.Cells
If OneCell.Text = "中" Then
If uRng Is Nothing Then
Set uRng = OneCell
Else
Set uRng = Union(uRng, OneCell)
End If
End If
Next OneCell FillRed uRng End With Set Reg = Nothing
Set Mh = Nothing
Set uRng = Nothing
'Set xmlhttp = Nothing
End Sub
Sub Sort2003(ByVal RngWithTitle As Range, Optional SortColumnNo As Long = 1)
With RngWithTitle
.Sort key1:=RngWithTitle.Cells(1, SortColumnNo), Order1:=xlAscending, Header:=xlYes, _
MatchCase:=False, Orientation:=xlTopToBottom, SortMethod:=xlPinYin
End With
End Sub
Sub SetBorders(ByVal Rng As Range)
With Rng.Borders
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.Weight = xlThin
End With
End Sub
Sub FillRed(ByVal Rng As Range)
With Rng.Font
.ColorIndex = 3
.Bold = True
End With
End Sub
20170728xlVba还是这个混蛋的更多相关文章
- 优秀的VeriSign和混蛋的GlobalSign
由于领导不懂行,直接购买了GlobalSign的证书,结果引起了我这个开发人员痛苦的2星期之旅,说说大体情况: 目的:对买来的一个驱动程序进行签名,使之能够在Win x64情况下安装和使用 下载Win ...
- 20170728xlVba SSC_LastTwoDays
Public Sub SSCLastTwoDays() Dim strText As String Dim Reg As Object, Mh As Object, OneMh As Object D ...
- 20170728xlVba SSC_TODAY
Public Sub SSC_TODAY() Dim strText As String Dim Reg As Object, Mh As Object, OneMh As Object Dim i ...
- 20170728xlVba简单的匹配
Sub MatchData() Dim i As Long, EndRow As Long, Key As String Dim Rng As Range Dim Dic As Object Set ...
- 20170728xlVBA改转置一例
Sub 导出() Dim Sht As Worksheet, ShtName As String Dim NextRow As Long, NextRow2 As Long Dim iRow As L ...
- nodejs项目mysql使用sequelize支持存储emoji
nodejs项目mysql使用sequelize支持存储emoji 本篇主要记录nodejs项目阿里云mysql如何支持存储emoji表情. 因由 最近项目遇到用户在文本输入emoji进行存储的时候导 ...
- SQL Server页类型汇总+疑问
该文章整理自:http://www.sqlnotes.info/2011/10/31/page-type/ SQL Server中包含多种不同类型的页,来满足数据存储的需求.不管是什么类型的页,它们的 ...
- 【转】基于linux下的dm9000网卡移植全分析
转自:http://blog.sina.com.cn/s/blog_6abf2c04010189ui.html DM9000可以直接与ISA总线相连,也可以与大多数CPU直接相连.Mini2440采用 ...
- 自己动手,实现一种类似List<T>的数据结构(一)
前言 上一篇文章<Unity3D中常用的数据结构总结与分析>简单总结了一下小匹夫工作中经常遇到的一些数据结构.不过小匹夫一直有种观点,就是光说的热闹实际啥也不做真的没啥意思.光说不练假把式 ...
随机推荐
- Impala与Hive的比较
1. Impala架构 Impala是Cloudera在受到Google的Dremel启发下开发的实时交互SQL大数据查询工具,Impala没有再使用缓慢的Hive+MapReduce批 ...
- python 展开嵌套的序列
将一个多层嵌套的序列展开成一个单层列表 可以写一个包含yield from 语句的递归生成器来轻松解决这个问题. from collections import Iterable def flatte ...
- Neutron网络学习
学习 Neutron 系列文章: 转http://www.cnblogs.com/sammyliu/p/4622563.html (1)Neutron 所实现的网络虚拟化 (2)Neutron Ope ...
- Hive 大数据倾斜总结
在做Shuffle阶段的优化过程中,遇 到了数据倾斜的问题,造成了对一些情况下优化效果不明显.主要是因为在Job完成后的所得到的Counters是整个Job的总和,优化是基于这些 Counters得出 ...
- linux常用命令:ping 命令
Linux系统的ping 命令是常用的网络命令,它通常用来测试与目标主机的连通性,我们经常会说“ping一下某机器,看是不是开着”.不能打开网页时会说“你先ping网关地 址192.168.1.1试试 ...
- Notes of Head.First.HTML.and.CSS.2nd.Edition
What does the web server do? tirelessly waiting for requests from webbrowsers What does the web brow ...
- 关于windows下c++生成的exe发布时的依赖dll问题
如同linux下通常要求安装特定版本的libstdc++一样,windows下vc++生成的exe发布时的依赖dll问题,可以参见帖子,http://bbs.csdn.net/topics/39105 ...
- go-restful 实现一个web server
go web server 1. 在ubuntu上安装go. 在ubuntu14.04上目前,最高的版本是golang-1.6 $ sudo apt-get install golang-1.6 $ ...
- 20145306 张文锦 网络攻防 web基础
20145306 网络攻防 web基础 实验内容 WebServer:掌握Apache启停配置修改(如监听端口)前端编程:熟悉HTML+JavaScript.了解表单的概念编写不同的HTML网页,放入 ...
- intent bundle的使用
1.什么是bundle Bundle主要用于传递数据:它保存的数据,是以key-value(键值对)的形式存在的.我们经常使用Bundle在Activity之间传递数据,传递的数据可以是boolean ...