+ Reply to Thread
Results 1 to 12 of 12

Can't insert or delete table rows.

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    205

    Can't insert or delete table rows.

    Hi Guys,
    I am posting in the General as I am getting the issue with or without vba.

    Attached is a cutdown version of a workbook that has been working fine for more than 5 years.

    I have added records to the cutdown version so far without any problems (so far).

    Today on the full version of the workbook after adding about 15 records spread through the 4 tables using the ?Add Record? button, I get a debug with ?Run-time Error 1004? ?This won?t work because it would move cells in a table on your worksheet?.

    If I ?End? and try to insert a table row OR delete a table row I get a dialog ?This won?t work because it would move cells in a table on your worksheet?

    I can still add records to previous sheets.

    Each sheet in the full workbook is a copy of the previous sheet with the data removed, the cutdown version sheet is also a copy of its previous months sheet but with the previous months sheet deleted.


    The debug is in the frmDataEntry .ListRows.Add AlwaysInsert:=True

       Set lo = ActiveSheet.ListObjects(x)   'set ListObject (lo) to the Table Selected above (x)                            
                                With lo  'With that List Object (x)
    'Allow the Table to grow
                                    .ListRows.Add AlwaysInsert:=True

    Any ideas why this should have happened?
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    205

    Re: Can't insert or delete table rows.

    Anyone any ideas please?

  3. #3
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    205

    Re: Can't insert or delete table rows.

    Well over 100 people have looked at this over the past week, but no suggestions

  4. #4
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,289

    Re: Can't insert or delete table rows.

    Why not 4 table in 4 different sheet & calculate in summary sheet with pivot table.
    In 4 different sheet add column card payment & statement date.


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  5. #5
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    205

    Re: Can't insert or delete table rows.

    Thank you very much for showing an interest.

    We have 4 tables on the sheet for the 4 catagories and a sheet for each month, so at least 60 sheets so far. This is how the owner/user and her accountant requires the data.

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

    Re: Can't insert or delete table rows.

    You are mixing the 'cosmetics' with the 'practicalities' forget about the 'pretty' data storage.
    Store your data in one table, then extract it to a 'report template' in that manner you will eliminate the messy insertion of rows in tables stacked (not a good idea).
    Your data storage table needs to be as formatted in sheet1 - I notice in attached file a sheet at Sheet126 - if this is the case your file must be 'bloated'.
    One simple table could contain a thousand years of information that could be extracted to a report at any time - apply the 'KISS' principle to data management.
    My guess is that Excel is falling over because some limit has inadvertently been reach - e.g. look at formula in 'D31' has any of the elements exceeded the 255 character string length ???
    Attached Files Attached Files
    Torachan,

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

  7. #7
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    205

    Re: Can't insert or delete table rows.

    Hi Torachan,
    Thank you for your reply.
    I understand exactly what you are saying about having all the data in 1 table and it does make perfect sense. I will have the conversation with the owner/user of the workbook. Before I do, I will create a new workbook as your sheet1 and import data form the last few months to demonstrate how it would look and work.
    I also think you are right with the formulas exceeded the 255 character.
    I will now mark the thread as solved.
    Kind Regards
    Keith

  8. #8
    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
    48,933

    Re: Can't insert or delete table rows.

    Well over 100 people have looked at this over the past week, but no suggestions
    Well, that can happen.

    You've posted in General which means that some people who don't know VBA might look and back away immediately. Then, there might be some, like me, who make a lot of responses on my iPad and phone ... no VBA. And there might be some who can't replicate the problem and don't want to clutter the thread up. Lots of reasons for not replying. And, once you've bumped the thread, it won't show up in unanswered threads which some folk go to to see what, well, hasn't been answered.

    Anyway, all that said, I have now opened your workbook on my Windows Laptop. Security on Windows prevents the opening of macro enabled workbooks as it flags (blocks) them and you have to manually remove the block.

    So, I have tested the basic premise, can I insert and delete rows in the Table, and it seems I can. The implication being that although you may not be using VBA to add rows, something is interfering with the process.

    As you have stated that you can add records to the cut down version of the spreadsheet, I suppose it is only to be expected that I can too, albeit without VBA.

    From a practical point of view, you need to upload a copy of the workbook that demonstrates the problem with clear instructions as to how to replicate the issue.
    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


  9. #9
    Forum Contributor
    Join Date
    11-30-2005
    Location
    Penzance Cornwall, UK
    MS-Off Ver
    Office 365
    Posts
    205

    Re: Can't insert or delete table rows.

    Hi TMS,
    Thank you for your reply.
    I originally posted in the general forum as the problem was present with no vba involved, although I did include the same problem with vba code included…..my mistake, I should have posted in the VBA forum.
    I take your point about “Bumping” won't show up in unanswered threads, I never even considered that.
    I have decided to take the advice of Torachan in the above post and will now mark the thread as solved.
    Kind Regards,
    Keith

  10. #10
    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
    48,933

    Re: Can't insert or delete table rows.

    Can't argue with the advice torachan has offered. In my mind, it is always best to have ALL the raw data in a single flat (normalised) table on one sheet. Add a column(s) for the date and/or month to allow differentiation of records. You can filter, sort and chart the data. You can also analyse the data using Pivot Tables and Pivot Charts. With O365, you have a vast array of new functions that will allow you to extract and manipulate the data.

    And, if I didn't mention it before, the more sheets you have, the more difficult it becomes to manage them … and even find what you are looking for.

    Good luck.

  11. #11
    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
    48,933

    Re: Can't insert or delete table rows.

    You're welcome. Thanks for the rep.

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

    Re: Can't insert or delete table rows.

    thanks for the feedback and added rep point

+ 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. Replies: 2
    Last Post: 12-07-2020, 06:42 AM
  2. [SOLVED] Worksheet change event to exclude the Insert Rows and Delete Rows
    By Un-Do Re-Do in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-15-2018, 04:51 AM
  3. Table that insert measures and insert blank rows
    By searme in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-08-2016, 04:49 AM
  4. [SOLVED] VBA script to Insert and Delete rows at the end of a named table
    By mikedill24 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-16-2014, 09:25 AM
  5. [SOLVED] VBA insert/delete rows to accommodate exact number of rows from incoming data
    By iloc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-12-2012, 06:19 PM
  6. Insert / Delete Rows depending upon Dynamic Built Table
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-10-2012, 11:45 AM
  7. Delete Rows based on cell value and then Insert rows alternatively with a formula
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-11-2008, 04:27 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