Results 1 to 9 of 9

Autofill Until is Empty

Threaded View

  1. #1
    Registered User
    Join Date
    11-03-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    22

    Autofill Until is Empty

    Help!!

    Here is my code

    Sub AAA()
    Dim lastrow As Long
         
        lastrow = Worksheets("07DS").Range("A2").End(xlDown).Row
        With Worksheets("07DS").Range("E2")
        
        If Range("B2") = "" Then
        Exit Sub
        Else
                .AutoFill Destination:=Range("E2:E" & lastrow&), Type:=xlFillCopy
    End If
    End With
    End Sub
    What is meant to happen is that Column E is autofilled until column A is empty! However this is not working column E is Autofilling until the end of the sheet.

    Any help with where I went wrong in my code? PS column A will have a dynamic list, that is each time it could have 1 or 100 rows depending thats why I need E to autofill until A is blank.

    Thank you
    Last edited by Dnass; 11-22-2013 at 01:54 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] autofill until adjacent cell empty
    By Hassan1977 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-03-2013, 01:54 PM
  2. [SOLVED] How to autofill any formula till last empty cell
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-16-2013, 08:56 AM
  3. 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
  4. AutoFill Above in empty cells
    By excelgrrl in forum Excel General
    Replies: 3
    Last Post: 12-15-2009, 06:40 PM
  5. Macro to autofill a number in empty cells in a column
    By excelaspire0219 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-29-2009, 12:03 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