Results 1 to 4 of 4

Autofill destination problem

Threaded View

  1. #1
    Registered User
    Join Date
    07-01-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2003
    Posts
    63

    Autofill destination problem

    Hello!

    In one sheet I have data which is connected with formula with data in another sheet. I want every day with macro to autofill the data in the first sheet, but I don't know how to set a destination.

    I tried this :
    Private Sub CommandButton1_Click()
    
    Range("A1").Activate
    
    Do While Not IsEmpty(ActiveCell)
    ActiveCell.Offset(1, 0).Activate
    Loop
    
    Set a = ActiveCell
    Set b = ActiveCell.Offset(-1, 0)
    Set c = ActiveCell.Offset(-1, 1)
    Set d = ActiveCell.Offset(0, 1)
    
    b.Select
    Selection.AutoFill Destination:=Range("b:a"), Type:=xlFillDefault
    c.Select
    Selection.AutoFill Destination:=Range("c:d"), Type:=xlFillDefault
    
    End Sub

    but it is not working. How can I change this code so it works?
    Attached Files Attached Files
    Last edited by cassiopea; 02-08-2012 at 08:29 AM.

Thread Information

Users Browsing this Thread

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

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