+ Reply to Thread
Results 1 to 3 of 3

macro to autofill values only

  1. #1
    Registered User
    Join Date
    11-13-2008
    Location
    indiana
    Posts
    15

    macro to autofill values only

    hello all

    i am using code to fill down a column. the code works great if the cells only contain values and not formulas.if its a formula then it fills the formulas series when i just want the value copied down. my goal here is to fill the blank cells created when i use the subtotal function. i have tried the different autofill options to no avail.here is the code

    PHP Code: 
    Dim LastRow As Long
        
        LastRow 
    Sheet2.Cells(Sheet2.Rows.Count4).End(xlUp).Row
        
        Sheet2
    .Range("a4").AutoFill Destination:=Range("a4:a" LastRow), Type:=4
        Sheet2
    .Range("c4").AutoFill Destination:=Range("c4:c" LastRow), Type:=4
        Sheet2
    .Range("e4").AutoFill Destination:=Range("e4:e" LastRow), Type:=4
        Sheet2
    .Range("f4").AutoFill Destination:=Range("f4:f" LastRow), Type:=4
        Sheet2
    .Range("g4").AutoFill Destination:=Range("g4:g" LastRow), Type:=
    looking for that magic solution i so often find here

    am using 2007 by the way

    thanks much

  2. #2
    Registered User
    Join Date
    11-19-2008
    Location
    Oxford, UK
    MS-Off Ver
    2003 (Work) / 2007 (Home)
    Posts
    60

    Re: macro to autofill values only

    What about using Goto Special?

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: macro to autofill values only

    Post up a good sample of the data that is causing you problems, and show a "desired result" on another page to make the goal clear. That will help us fully visualize your issue.

    GO ADVANCED and use the paperclip icon to attach a workbook.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

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