User Tag List

First 1234 Last

Results 11 to 20 of 89

  1. #11
    FRACTALICIOUS phobik's Avatar
    Join Date
    Apr 2009
    Posts
    7,370

    Default

    Quote Originally Posted by Lark View Post
    What is this? What is this excel sheets thing mentioned? What are these strange sorcerous computer skills?
    Yeah Jonnyboy, share your 1337 h4x0r skillz with the rest of the class.

    To avoid criticism, do nothing, say nothing, be nothing.
    ~ Elbert Hubbard

    Music provides one of the clearest examples of a much deeper relation between mathematics and human experience.

  2. #12
    null Jonny's Avatar
    Join Date
    Sep 2009
    MBTI
    FREE
    Posts
    2,486

    Default

    Here is the code I wrote, which probably looks like a garbled mess to those with coding experience and an eye for coding aesthetics (and there are no tabs in this version since they don't copy over). Also, it should be noted that there is a bunch of stuff going on in excel itself which accounts for all the pretty formatting.

    Sub Extract()
    Dim ie As New InternetExplorer
    Dim doc As HTMLDocument
    Dim x As Integer
    Dim pstdte As String
    Dim pstttl As String
    Dim Today As String
    Dim Yesterday As String
    Dim Minute As Integer
    Dim Hour As Integer
    Dim Day As Integer
    Dim Month As Integer
    Dim Year As Integer
    Dim Search As String

    Search = InputBox("Insert Search String")

    If Search = "" Then GoTo 200

    Today = Format$(Now(), "mm-dd-yyyy")
    Yesterday = Format$(Now() - 1, "mm-dd-yyyy")

    On Error GoTo 100

    Sheets("Data").Range("A:C").Clear
    ie.Visible = False

    x = 1
    For j = 1 To 900
    ie.navigate Search & "&pp=&page=" & j
    Do
    DoEvents
    Loop Until ie.readyState = READYSTATE_COMPLETE
    Set doc = ie.document

    For i = 0 To 24
    pstdte = doc.getElementsByClassName("date")(i).innerText
    Sheets("Data").Cells(x, 1) = pstdte
    pstttl = doc.getElementsByClassName("username_container")(i ).innerText
    pstttl = Mid(pstttl, 9, InStr(1, pstttl, vbNewLine) - 9)
    Sheets("Data").Cells(x, 2) = pstttl
    x = x + 1
    Next i

    Next j

    100:
    On Error Resume Next
    ie.Quit

    With Sheets("Data")
    For i = 1 To x
    Cells(i, 1).Value = Replace(Cells(i, 1).Value, "Today", Today)
    Cells(i, 1).Value = Replace(Cells(i, 1).Value, "Yesterday", Yesterday)
    Next i
    End With

    MsgBox ("Done! " & x & " entries found!" & vbNewLine & vbNewLine _
    & "Ready to proceed?")

    If vbNo Then GoTo 200

    150:
    On Error GoTo 200
    For i = 1 To x - 1
    With Sheets("Data").Cells(i, 1)
    Year = Mid(.Value, 7, 4)
    Month = Mid(.Value, 1, 2)
    Day = Mid(.Value, 4, 2)
    If Right(.Value, 2) = "AM" Then
    Hour = Mid(.Value, 13, 2)
    Else
    Hour = Mid(.Value, 13, 2) + 12
    End If
    If Hour = 12 Then Hour = 0
    If Hour = 24 Then Hour = 12
    Minute = Mid(.Value, 16, 2)
    End With
    With Sheets("Data").Cells(i, 3)
    .Value = DateSerial(Year, Month, Day)
    .Value = .Value + Hour / 24
    .Value = .Value + Minute / 1440
    End With
    Next i

    With Sheets("Calcs")
    .Range("A:B").Clear
    .Range("A:A").Value = Sheets("Data").Range("B:B").Value
    .Range("A:A").RemoveDuplicates Columns:=1, Header:= _
    xlNo
    x = 1
    Do Until IsEmpty(.Cells(x, 1)) = True
    .Cells(x, 2).Value = "=COUNTIF(Data!B:B,A" & x & ")"
    x = x + 1
    Loop
    End With

    Columns("A:B").Select
    Range("B1").Activate
    ActiveWorkbook.Worksheets("Calcs").Sort.SortFields .Clear
    ActiveWorkbook.Worksheets("Calcs").Sort.SortFields .Add Key:=Range("B1:B" & x _
    ), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("Calcs").Sort
    .SetRange Range("A1:B" & x)
    .Header = xlGuess
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
    End With

    Application.Run "ChartScrub"

    200:
    End Sub

    Sub ChartScrub()
    Dim Img As Picture
    Dim Cht As Excel.ChartObject
    Dim Rng As Excel.Range

    For Each sh In ActiveWorkbook.Sheets
    sh.Calculate
    Next sh

    Sheets("Charts").ChartObjects("Chart 1").Activate
    With ActiveChart
    .Axes(xlValue).MaximumScale = Sheets("Calcs").Range("ymax").Value
    .Axes(xlValue).MinimumScale = 0
    .Axes(xlCategory).MaximumScale = Sheets("Calcs").Range("xmax").Value
    .Axes(xlCategory).MinimumScale = Sheets("Calcs").Range("xmin").Value
    End With

    Set Rng = Sheets("Charts").Range("A1:Y86")
    Rng.Select
    Selection.CopyPicture Appearance:=xlScreen, Format:=xlBitmap
    Set Cht = ActiveSheet.ChartObjects.Add(0, 0, Rng.Width + 10, Rng.Height + 10)
    With Cht
    .Chart.Paste
    .Chart.Export Filename:="C:\Users\Jonathan\Documents\Charts.jpg" , Filtername:="JPG"
    .Delete
    End With

    End Sub
    [SIGPIC][/SIGPIC]

  3. #13
    ^He pronks, too! Magic Poriferan's Avatar
    Join Date
    Nov 2007
    MBTI
    Yin
    Enneagram
    One sx/sp
    Posts
    13,909

    Default

    Sure, I might as well see what mine are like.
    Go to sleep, iguana.


    _________________________________
    INTP. Type 1>6>5. sx/sp.
    Live and let live will just amount to might makes right

  4. #14
    null Jonny's Avatar
    Join Date
    Sep 2009
    MBTI
    FREE
    Posts
    2,486

    Default RESULTS: SuchIrony

    @SuchIrony - Click on image for full-sized version.

    [SIGPIC][/SIGPIC]

  5. #15
    null Jonny's Avatar
    Join Date
    Sep 2009
    MBTI
    FREE
    Posts
    2,486

    Default RESULTS: chana

    @chana - Click on image for full-sized version.

    [SIGPIC][/SIGPIC]

  6. #16
    null Jonny's Avatar
    Join Date
    Sep 2009
    MBTI
    FREE
    Posts
    2,486

    Default RESULTS: YWIR

    @YWIR

    [SIGPIC][/SIGPIC]

  7. #17
    null Jonny's Avatar
    Join Date
    Sep 2009
    MBTI
    FREE
    Posts
    2,486

    Default RESULTS: Rasofy

    @Rasofy - Click on image for full-sized version.

    [SIGPIC][/SIGPIC]

  8. #18
    royal member Rasofy's Avatar
    Join Date
    Mar 2011
    MBTI
    INTP
    Enneagram
    5w6 sp/sx
    Posts
    5,932

    Default

    Now everyone knows that my sleep pattern is totally unregulated.
    -----------------

    A man builds. A parasite asks 'Where is my share?'
    A man creates. A parasite says, 'What will the neighbors think?'
    A man invents. A parasite says, 'Watch out, or you might tread on the toes of God... '


    -----------------

  9. #19
    FRACTALICIOUS phobik's Avatar
    Join Date
    Apr 2009
    Posts
    7,370

    Default

    Quote Originally Posted by Rasofy View Post
    Now everyone knows that my sleep pattern is totally unregulated.
    xii galera, cê axa ki eh axim taum populah? aeaeaeaea
    To avoid criticism, do nothing, say nothing, be nothing.
    ~ Elbert Hubbard

    Music provides one of the clearest examples of a much deeper relation between mathematics and human experience.

  10. #20
    null Jonny's Avatar
    Join Date
    Sep 2009
    MBTI
    FREE
    Posts
    2,486

    Default RESULTS: Lark

    @Lark - Click on image for full-sized version.

    [SIGPIC][/SIGPIC]

Similar Threads

  1. What your favorite colors say about your personality
    By Azure Flame in forum General Psychology
    Replies: 31
    Last Post: 01-16-2014, 08:24 AM
  2. What is the one thing you want people to say about you after you die?
    By A window to the soul in forum The Bonfire
    Replies: 75
    Last Post: 02-28-2012, 01:39 AM
  3. What does your facebook page say about you?
    By King sns in forum The Bonfire
    Replies: 46
    Last Post: 02-25-2012, 02:30 AM
  4. What Your Taste in Art Says about You
    By BlueSprout in forum Online Personality Tests
    Replies: 74
    Last Post: 08-08-2010, 02:10 PM
  5. [NT] NT: what do you wish your parents had known about you?
    By MonkeyGrass in forum The NT Rationale (ENTP, INTP, ENTJ, INTJ)
    Replies: 80
    Last Post: 07-04-2009, 12:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Single Sign On provided by vBSSO