+ Reply to Thread
Results 1 to 3 of 3

Overwrite existing cells

Hybrid View

  1. #1
    Registered User
    Join Date
    10-05-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    14

    Overwrite existing cells

    I have the following macro

     Sheets("24hr to 9am").Select
        Cells(1, 1).Select
        With ActiveSheet.QueryTables.Add(Connection:= _
            "URL;" & Range("One!A17").Value _
            , Destination:=Range("$A$1"))
            .FieldNames = True
            .RowNumbers = False
            .FillAdjacentFormulas = False
            .PreserveFormatting = True
            .RefreshOnFileOpen = False
            .BackgroundQuery = True
            .RefreshStyle = xlInsertDeleteCells
            .SavePassword = False
            .SaveData = True
            .AdjustColumnWidth = True
            .RefreshPeriod = 0
            .WebSelectionType = xlAllTables
            .WebFormatting = xlWebFormattingNone
            .WebPreFormattedTextToColumns = True
            .WebConsecutiveDelimitersAsOne = True
            .WebSingleBlockTextImport = False
            .WebDisableDateRecognition = False
            .WebDisableRedirections = False
            .Refresh BackgroundQuery:=False
    End With
        Sheets("Since 9am").Select
            
    End Sub


    The data I am getting contains 7 columns, however every time I run the macro it does not overwrite the current data. So new data gets pasted in every 8th column.
    Last edited by Mulberry; 11-13-2015 at 05:48 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,661

    Re: Want new data in cell A1

    title updated and code tags applied.
    Last edited by protonLeah; 11-13-2015 at 11:27 PM.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    10-05-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Overwrite existing cells

    Title updated and code tags applied.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 05-14-2015, 02:48 PM
  2. [SOLVED] Wirte macro that copies data from 1 cell to a different cell based on data in a third cell
    By Geoff Jones in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-11-2013, 12:37 PM
  3. Macro to input data on specific cell based on range of another cell data
    By tatisif in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-03-2013, 12:06 PM
  4. [SOLVED] Formula Needed to copy data from a cell based on data entered into another cell
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-10-2013, 03:16 AM
  5. excel formula working on a cell which is having data in a data validation cell
    By sujithy007 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-16-2013, 04:18 AM
  6. [SOLVED] combing multiple cell data into one cell (show string of data in one cell)
    By EvenRtrsUsExcel in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-13-2013, 09:00 PM
  7. UserForm data paste to cell, cell character limit cutting off data
    By mpkavanagh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-17-2011, 01:31 PM

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