Results 1 to 2 of 2

Thread: Getting data with web query and rearrange the data

  1. #1
    Member
    Join Date
    Apr 2014
    Posts
    45
    Rep Power
    0

    Getting data with web query and rearrange the data

    Getting data with web query and rearrange the data

    thanks for any help on this,

    when i enter the ticker symbol to A2:A100, the vba code to get the data and list them to B2:F100
    Last edited by mrprofit; 03-18-2016 at 02:30 PM.

  2. #2
    Member mrmmickle1's Avatar
    Join Date
    Sep 2012
    Posts
    51
    Rep Power
    12
    This code will work....

    Please note that the IsNumber Function can be credited to Rick Rothstein.

    Code:
    Sub Test()
    
        Dim rng As Range
        Dim cll As Range
        Dim IntLp As Integer
        Dim strt As Integer
        
        Set rng = Sheets(1).Range("A1:M29")
    
        For Each cll In rng
            CllLen = Len(cll)
            If CllLen > 0 Then
                For IntLp = 1 To CllLen
                    strt = strt + 1
                    If IsNumber(Mid(cll, strt, IntLp)) <> True Then
                        cll.Value = Replace(cll.Value, Mid(cll, strt, IntLp), "")
                    End If
                strt = 0
                Next IntLp
            End If
        Next cll
    
    End Sub
    
    Function IsNumber(ByVal Value As String) As Boolean
     ' Uncomment the next statement out if you
     ' want to provide for plus/minus signs
     ' If Value Like "[+-]*" Then Value = Mid$(Value, 2)
     IsNumber = Not Value Like "*[!0-9.]*" And _
     Not Value Like "*.*.*" And _
     Len(Value) > 0 And Value <> "." And _
     Value <> vbNullString
    End Function
    Using Excel 2010

Similar Threads

  1. Replies: 2
    Last Post: 03-08-2014, 04:22 PM
  2. Replies: 3
    Last Post: 07-29-2013, 11:32 PM
  3. Conditional Insert Query Based on Data in Target Table
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 0
    Last Post: 06-23-2013, 04:24 PM
  4. Feed / Post Data on Web Page Using VBA
    By in.vaibhav in forum Excel Help
    Replies: 10
    Last Post: 01-10-2013, 05:00 PM
  5. Navigate Through Web links and get data
    By maruthi in forum Excel Help
    Replies: 0
    Last Post: 02-10-2012, 06:22 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
  •