+ Reply to Thread
Results 1 to 6 of 6

VBA form adding data to top of table not last row

  1. #1
    Registered User
    Join Date
    04-30-2023
    Location
    Australia
    MS-Off Ver
    Microsoft 365
    Posts
    3

    VBA form adding data to top of table not last row

    Hi hope someone can help im trying to make a form following a youtuber New to vba but have hit a tree when i add new data to a spreadsheet (Table) the form adds the data to the top in the headers row not the last row.
    Please Login or Register  to view this content.
    Screenshot 2023-05-01 134925.png
    if needed i can add full codes or even the excel sheet
    thanks

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: VBA form adding data to top of table not last row

    This
    Please Login or Register  to view this content.
    should be this
    Please Login or Register  to view this content.
    etc.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    04-30-2023
    Location
    Australia
    MS-Off Ver
    Microsoft 365
    Posts
    3

    Re: VBA form adding data to top of table not last row

    Thankyou so much this works i have a lot to learn when it comes to vba but i know now if i get a problem this is a great place for help.

  4. #4
    Registered User
    Join Date
    04-30-2023
    Location
    Australia
    MS-Off Ver
    Microsoft 365
    Posts
    3

    Re: VBA form adding data to top of table not last row

    ok it worked once and now im stuck again im going attact the workbook in the hope someone with more knowledge can fix this for me?
    DataEntry Worms help3.xlsm
    Last edited by DJ1966; 05-01-2023 at 02:40 AM.

  5. #5
    Forum Expert
    Join Date
    01-25-2011
    Location
    Belgium, Alveringem
    MS-Off Ver
    Excel 2003, 2007, 365
    Posts
    1,418

    Re: VBA form adding data to top of table not last row

    i suppose shdata is the right sheet and you have a listobject in A1 of that sheet, and that's the right listobject.
    Problem is, that it copies all the formats of the header, so there are a few lines to undo that.
    Please Login or Register  to view this content.
    another option was to copy and paste the formats of the 2nd row (if it has a 2nd row) to the 1st with something like
    Please Login or Register  to view this content.
    Last edited by bsalv; 05-01-2023 at 03:34 AM.
    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

  6. #6
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: VBA form adding data to top of table not last row

    @DJ1966, am I right in that you just want to add the next row to the end of the table, thus increasing the table size by one row.
    If so forget about finding range sizes etc., the syntax and methodology when dealing with 'structured tables' is somewhat different to referencing sheet ranges.
    I have incorporated your data into the approach I use (with the table referencing syntax) - hopefully some hints and tips are helpful.
    The general purpose of the 'structured table' is its ability to self-maintain (when referenced correctly it is dynamic as long as you do not manually incorporate extra blank rows).
    Attached Files Attached Files
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

+ 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] Trying to auto Sort table ascending after adding from form
    By gary lawrence in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-11-2022, 03:48 PM
  2. Load Data Form Table to Order Form Using VLookUp in VBA
    By Ivy_1011 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-03-2022, 03:00 AM
  3. Alternative to VLOOKUP when data is in min/ max (i.e. 0-5) form vs. table form
    By kelseygueldalewis in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-23-2017, 10:58 AM
  4. Adding new record to existing database table with a form
    By Mongoloid in forum Access Tables & Databases
    Replies: 2
    Last Post: 11-10-2016, 03:58 PM
  5. Replies: 0
    Last Post: 08-10-2016, 03:32 PM
  6. Replies: 13
    Last Post: 07-16-2016, 10:53 PM
  7. Adding "All Borders" with a User Form (Similar to Data Form)
    By kgreave1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-26-2012, 01:57 PM

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