+ Reply to Thread
Results 1 to 6 of 6

Selection Autofill to last row

Hybrid View

  1. #1
    Registered User
    Join Date
    06-18-2013
    Location
    Lithuania Kaunas
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    98

    Selection Autofill to last row

    hello guys i need some help

    i need macro whitish take my formula in cell and bring down to all rows


        Range("R3").Select
        Selection.AutoFill Destination:=Range("R3:R22"), Type:=xlFillDefault
        Range("R3:R22").Select
        Range("V3").Select
        Selection.AutoFill Destination:=Range("V3:V22"), Type:=xlFillDefault
        Range("V3:V22").Select
        Range("AD3:AF3").Select
        Selection.AutoFill Destination:=Range("AD3:AF22"), Type:=xlFillDefault
        Range("AD3:AF22").Select
    End Sub
    Something like this but not for range but for last row and not for active worksheet but for specifics sheet "Actona" "BXS" "NEPATVIRTINTI" "MOEMAX"

    i add sample all my formulas in hidden Row 3 i mark cells be yellow color which have formulas.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Selection Autofill to last row

    Sub fillmein()
        Dim ws As Worksheet
        Application.ScreenUpdating = 0
        
        For Each ws In ThisWorkbook.Worksheets
        
           With ws
           
             .Range("R3").AutoFill .Range("R3:R22"), Type:=xlFillDefault
             .Range("V3").AutoFill .Range("V3:V22"), Type:=xlFillDefault
             .Range("AD3:AF3").AutoFill .Range("AD3:AF22"), Type:=xlFillDefault
          End With
        Next
          Application.ScreenUpdating = True
    End Sub

  3. #3
    Registered User
    Join Date
    06-18-2013
    Location
    Lithuania Kaunas
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    98

    Re: Selection Autofill to last row

    No its sesame like my macro its run jest for row 22 ... but i need for last row. in my documents every day will be different number of rows.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Selection Autofill to last row

    Sub fillmein()
        Dim ws As Worksheet
        Application.ScreenUpdating = 0
        
        For Each ws In ThisWorkbook.Worksheets
        
           With ws
              LR = .Cells.Find("*", , , , xlByRows, xlPrevious).Row
             .Range("R3").AutoFill .Range("R3:R" & LR), Type:=xlFillDefault
             .Range("V3").AutoFill .Range("V3:V" & LR), Type:=xlFillDefault
             .Range("AD3:AF3").AutoFill .Range("AD3:AF" & LR), Type:=xlFillDefault
          End With
        Next
          Application.ScreenUpdating = True
    End Sub
    Last edited by AB33; 09-19-2013 at 06:20 AM.

  5. #5
    Registered User
    Join Date
    06-18-2013
    Location
    Lithuania Kaunas
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    98

    Re: Selection Autofill to last row

    and one more problem its working for all worksheets in workbook i need jest for worksheets whit specific name "Actona" "BXS" "NEPATVIRTINTI" "MOEMAX"

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Selection Autofill to last row

    For Each ws In ThisWorkbook.Worksheets(Array("Actona", "BXS", "NEPATVIRTINTI", "MOEMAX"))

+ 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. [SOLVED] Autofill selection without formatting
    By Critcho in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-02-2013, 06:58 AM
  2. Autofill a Dynamic Selection
    By georgeanaprop in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-05-2012, 12:36 PM
  3. Autofill selection down to last row
    By pluginguin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-03-2011, 11:04 AM
  4. range selection for autofill
    By LuuKoO in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2008, 06:07 AM
  5. AutoFill on selection
    By Desert Piranha in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-04-2006, 08:35 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