关于《MS_Spy_pp71.rar》文件的网友评论如下

楼层:1    昵称:access911    时间:2012年6月18日22:18:00
Function asdf()
    Dim i As Long
    Dim lngRnd As Long
    Dim aryNumber(2) As Long
    aryNumber(0) = 999     'upperbound
    aryNumber(1) = 1     'lowerbound
    For i = 2 To 20000
        lngRnd = Int((aryNumber(0) - aryNumber(1) + 1) * Rnd + aryNumber(1))
        Cells(i, 1).Value = lngRnd
        ActiveSheet.Range(Cells(i, 1), Cells(i, 1)).Show
    Next
    For i = 2 To 20000
        lngRnd = Int((aryNumber(0) - aryNumber(1) + 1) * Rnd + aryNumber(1))
        Cells(i, 2).Value = lngRnd
    Next
    For i = 2 To 20000
        lngRnd = Int((aryNumber(0) - aryNumber(1) + 1) * Rnd + aryNumber(1))
        Cells(i, 3).Value = lngRnd
    Next
End Function


Function WriteCell()
    Dim r As Excel.Range
    Dim shMap As Excel.Worksheet
    Dim iX As Long
    Dim iY As Long
    Dim iBin As Long
    
    Set r = ActiveWorkbook.Sheets("sheet1").Range("a2:c20000")
    Set shMap = ActiveWorkbook.Sheets("sheet3")
    Dim i As Long
        shMap.Columns.ColumnWidth = 0.5
        shMap.Rows.RowHeight = 8
    
    For i = 1 To r.Rows.Count
        iX = r.Cells(i, 1).Value
        iY = r.Cells(i, 2).Value
        iBin = r.Cells(i, 3)
        shMap.Cells(iX, iY).Value = iBin
        Select Case iBin
        Case 15
            shMap.Cells(iX, iY).Interior.Color = vbRed
        Case 20
            shMap.Cells(iX, iY).Interior.Color = vbGreen
        Case 30
            shMap.Cells(iX, iY).Interior.Color = vblue
        Case Else
            shMap.Cells(iX, iY).Interior.Color = vbWhite
        End Select
        
        
        
        
        
    Next
End Function

楼层:2    昵称:access911    时间:2012年6月19日0:01:00
将excel中指定工作表的指定区域导出为gif图像的功能
Function asdf()
    Dim c As Chart
    'Set c = ActiveChart
    Dim sh As Excel.Worksheet
    Dim shSource As Excel.Worksheet
    Set shSource = ActiveWorkbook.Sheets("sheet1")
    shSource.Select
    shSource.UsedRange.Select
    Selection.CopyPicture Appearance:=xlScreen, Format:=xlBitmap
    Set sh = ActiveWorkbook.Sheets("sheet2")
    Dim s As Shape
    Dim p As Picture
    Set p = sh.Pictures.Paste
    Set s = sh.Shapes.AddChart
    
    s.Width = p.Width + 2
    s.Height = p.Height + 2
    s.Chart.Paste
    
    s.Chart.Export "I:\MyTemp\asdf.gif"
End Function

 


请发表你的评价

昵称:
密码:
验证码: 看不清,换一张
评论:

 

 

上述言论由发言人自行负责, http://Access911.net 不对该言论负任何责任