+ Reply to Thread
Results 1 to 6 of 6

Autofill selection without formatting

  1. #1
    Registered User
    Join Date
    11-08-2012
    Location
    Reading, England
    MS-Off Ver
    Excel 2007
    Posts
    10

    Unhappy Autofill selection without formatting

    Help please, this is driving me crazy!

    I have several instances the rows of my worksheet are grouped by shading or borders, I want to add a column that has a new formula, but I don't want to destroy the formatting.

    When I do this manually, I enter the formula in the first cell, right-click on the bottom right corner of that cell, drag, then select "Fill without formatting", and this works perfectly.

    So I record this as a macro so I can genericize it:
    1. Relative ranging:
    Please Login or Register  to view this content.
    2. Absolute Ranging:
    Please Login or Register  to view this content.

    What I want to do is type my formula into the first cell, go to the previous column and hit CTRL-DOWN_ARROW to get to the end of the sheet, go to the next column (my target column), SHIFT-CTRL-UP_ARROW to select the range I want my new formula in, then run my macro to fill the formula to the selection.

    You say "why don't I just use the drag method?"... well, when your sheet is thousands of rows long, this is tedious and inaccurate. I should be able to do this on the selection object.

    What am I missing here? You can see from all the commented lines that I've every method I can think of, but I always get an error. The last attempt produced "Run-time error '1004': AutoFill method of Range class failed."

    Please Login or Register  to view this content.
    Thanks for your help, I know I'm missing something basic. I've looked up every reference I can find on AutoFill and Ranges but to no avail.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Autofill selection without formatting

    Try:
    Please Login or Register  to view this content.

  3. #3
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Autofill selection without formatting

    If you are going to be selecting the range, then you should be able to use this.

    Copy the cell with the formula (where you doing that first already?) then paste-special formulas.
    Last edited by GeneralDisarray; 08-01-2013 at 09:04 AM.
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  4. #4
    Registered User
    Join Date
    11-08-2012
    Location
    Reading, England
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Autofill selection without formatting

    Ahh... Copy-paste instead of fill.... I'll give that a go. THANKS!

  5. #5
    Registered User
    Join Date
    11-08-2012
    Location
    Reading, England
    MS-Off Ver
    Excel 2007
    Posts
    10

    Talking Re: Autofill selection without formatting

    Easy once you know how!

    Please Login or Register  to view this content.
    Works perfectly, thanks!
    And thanks for the very quick replies!

  6. #6
    Registered User
    Join Date
    11-08-2012
    Location
    Reading, England
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Autofill selection without formatting

    Quick enhancement to allow it to work over multiple columns:
    Please Login or Register  to view this content.

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