+ Reply to Thread
Results 1 to 4 of 4

VBA - Problem with Autofill syntax with ListObject table

  1. #1
    Registered User
    Join Date
    11-22-2014
    Location
    Wirral, UK
    MS-Off Ver
    Office 2007
    Posts
    6

    VBA - Problem with Autofill syntax with ListObject table

    New to this list but have used VBA with Excel for over 13 years both professionally and since retirement.

    I have a neat macro that annually archives 'dead' records from a membership database and then goes on to reset/clear columns ready for the new year. The macro has been progressively modified to exploit excel 'tables' and referenced via the ListObject technique and that worked last year. An enhancement this year is the introduction of a Row Id which is populated using any of the manual autofill techniques.

    I now want to automate the autofill using ListObject.Listcolumns notation.
    So far I have :
    With lobjMembershipList
    .ListColumns(64).DataBodyRange(1) = "1"
    .ListColumns(64).DataBodyRange(2) = "2"
    .ListColumns(64).DataBodyRange.AutoFill Destination:=.ListColumns(64).DataBodyRange, Type:=xlFillSeries
    End With

    The first two statements work but how do I need to modify the Autofill statement to get it to work?
    Software: Excel 2007

    Thanks
    Nigel

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VBA - Problem with Autofill syntax with ListObject table

    Hi,

    Try this :

    Please Login or Register  to view this content.
    Regards
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Registered User
    Join Date
    11-22-2014
    Location
    Wirral, UK
    MS-Off Ver
    Office 2007
    Posts
    6

    Re: VBA - Problem with Autofill syntax with ListObject table

    Hi Karedog, Great solution with a use of Resize I hadn't thought possible and it works!
    Thanks,
    Nigel
    UK

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VBA - Problem with Autofill syntax with ListObject table

    Hi Nigel,

    You are welcome, and many thanks for the reputation point.

    Regards

+ 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. [SOLVED] Syntax problem with Autofill
    By vonb3ta in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-17-2013, 06:09 AM
  2. Replies: 4
    Last Post: 06-26-2012, 09:11 AM
  3. Table ListObject Filter
    By efernandes67 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-23-2011, 07:40 AM
  4. Syntax problem defining range for pivot table
    By Richard in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-14-2006, 02:55 PM
  5. [SOLVED] A mysterious problem about ListObject
    By Frederick Chow in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-01-2006, 05:10 AM

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