+ Reply to Thread
Results 1 to 6 of 6

Autocopy formula

  1. #1
    Registered User
    Join Date
    08-19-2007
    Posts
    23

    Autocopy formula

    Can anyone please provide the code used which allows excel to autocopy a formula down a column to the point of the last entry in the preceding column.

    Many thanks,

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Never tried it, but maybe this:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-19-2007
    Posts
    23
    It doesn't like that formula....

    I know it's close though because I did see one written before but can't remember where.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    It likes this one:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-19-2007
    Posts
    23
    Hi

    Thanks, that worked ok...but...

    Is there a way to change the Range Selection from a specific cell i.e. C2, to whatever cell is selected in the worksheet, with the autofill proceeding from there? Also, how can the Macro be adapted to allow the autofill to proceed to the last row, even if there are any blank cells in some of the rows above within the preceding column?

    The code is shown below.

    Thanks,

    Sub ConfigureCaseSize()
    '
    ' ConfigureCaseSize Macro
    ' Determines Case Size from the pack size
    '
    ' Shortcut CTRL+Shift+P
    '
    Range("c2").Select
    ActiveCell.FormulaR1C1 = _
    "=IF(RC[-1]=6,""2 x 3"",IF(RC[-1]=12,""3 x 4"",""Amend""))"
    ActiveCell.AutoFill Range(ActiveCell, ActiveCell.Offset(, -1).End(xlDown).Offset(, 1))
    End Sub

  6. #6
    Registered User
    Join Date
    08-19-2007
    Posts
    23
    Bump

    Any suggestions anyone...?

+ 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