Results 1 to 4 of 4

convert this URL macrocode to VBA

Threaded View

  1. #1
    Registered User
    Join Date
    09-26-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    80

    convert this URL macrocode to VBA

    I have a list of URLs in sheet1 for web query. In few of the URLs to work this below code need run. Because few of those urls gives the result in column A, B, C or D and I want the results in column A. It will be great if I can mention the the sheet no in code. Can anybody help me please.

    
    Sub Macro6()
    '
    ' Macro6 Macro
    '
    
    '
        With ActiveSheet.QueryTables.Add(Connection:= _
            "URL;http://", Destination:=Range( _
            "$A$1"))
            .Name = "control"
            .FieldNames = True
            .RowNumbers = False
            .FillAdjacentFormulas = False
            .PreserveFormatting = False
            .RefreshOnFileOpen = False
            .BackgroundQuery = True
            .RefreshStyle = xlInsertDeleteCells
            .SavePassword = False
            .SaveData = True
            .AdjustColumnWidth = True
            .RefreshPeriod = 0
            .WebSelectionType = xlAllTables
            .WebFormatting = xlWebFormattingAll
            .WebPreFormattedTextToColumns = True
            .WebConsecutiveDelimitersAsOne = True
            .WebSingleBlockTextImport = False
            .WebDisableDateRecognition = False
            .WebDisableRedirections = False
            .Refresh BackgroundQuery:=False
        End With
        Range("B1:B5").Select
        Range("B5").Activate
        Selection.Cut
        Range("C1:C5").Select
        Range("C5").Activate
        Selection.Cut
        Range("D1:D5").Select
        Range("D5").Activate
        Selection.Cut
        Range("A16").Select
    End Sub
    Last edited by maria.blue44; 04-11-2013 at 01:32 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1