Results 1 to 4 of 4

VBA autofill info down to bottom of data set

Threaded View

  1. #1
    Registered User
    Join Date
    02-16-2016
    Location
    Chicago
    MS-Off Ver
    2010
    Posts
    15

    VBA autofill info down to bottom of data set

    I've got a macro where I'm trying to do the following:
    1. Format the information in the "CleanData" tab
    2. Copy the data into the "Raw Data" tab at the bottom of the current data set
    3. Input a value into the "Week" and "Year" column of the "Raw Data" tab and then copy those values to the bottom of the data set that I just copied down

    the following VBA code is what I have so far:

    Sub FormatData()
    '
    ' FormatData Macro
    '
    
    '
        Sheets("CleanData").Select
        Columns("B:B").Select
        Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
        Columns("A:A").Select
        Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
            TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
            Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
            :="(", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
        Columns("B:B").Select
        Selection.Replace What:=")", Replacement:="", LookAt:=xlPart, _
            SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
            ReplaceFormat:=False
        Range("A1:S35").Select
        Selection.Copy
        Sheets("Raw Data").Select
        Range("C4").Select
        Selection.End(xlDown).Offset(1, 0).Select
        ActiveSheet.Paste
        Range("B4").Select
        Selection.End(xlDown).Offset(1, 0).Select
        Value1 = InputBox(prompt:="Week #")
        ActiveCell.FormulaR1C1 = Value1
        Selection.Offset(0, -1).Select
        Value1 = InputBox(prompt:="Year")
        ActiveCell.FormulaR1C1 = Value1
        Range(ActiveCell, ActiveCell.Offset(0, 1)).Select
        Selection.AutoFill Range(ActiveCell.Address, Cells(LastRow, ActiveCell.Column))
    
    End Sub
    The issue I'm having is once I get to the "Selection.AutoFill Range(ActiveCell.Address..." - I can't find a way to select the two cells I've just input data for and then autofill the data in those cells to the bottom of the current data set. Note that I'd like to be able to do this several times so the data set will continue to grow and grow. Any help is appreciated - thanks in advance!!
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to autofill info
    By tulipgen in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-29-2016, 11:12 AM
  2. Macro for Autofill removes header info when there is no data to autofill
    By esturan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-06-2012, 01:42 PM
  3. Search for character, populate a tab, add new info at the bottom
    By mitylene in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-22-2008, 09:22 AM
  4. Formula to Autofill Info based on Other Data
    By SamanthaM in forum Excel General
    Replies: 1
    Last Post: 10-05-2005, 04:05 PM
  5. repeat info at bottom and top of every page
    By Andrew in forum Excel General
    Replies: 1
    Last Post: 09-19-2005, 10:05 AM
  6. [SOLVED] Adding info in the row at the bottom using macro?
    By Carrie in forum Excel General
    Replies: 2
    Last Post: 04-14-2005, 12:06 PM
  7. AutoFIll -by dragging the bottom-right corner of the cell
    By Venkatesh V in forum Excel General
    Replies: 5
    Last Post: 02-23-2005, 01:06 PM

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