+ Reply to Thread
Results 1 to 6 of 6

How to stop formula from appearing in VBA generated table

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-12-2021
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    118

    How to stop formula from appearing in VBA generated table

    I am using VBA to generate a table.
    I do not understand why a formula is showing in one of the columns. It is also an incorrect formula so it mucking up the table. As I made this worksheet up a while ago, I cannot remember how I got the formula there in the first place.

    The problem:
    At the start, on the worksheet there is only the heading of the table and no formula in any column (nor any values).
    I am using two categories on a userform to prefill the data from another table in the spreadsheet using VBA.
    However, once I click on the two categories and the table data is populated, an incorrect formula pops up in one column. This over-rides the vba.
    When I click the userform "new", all rows except for the headings go away. At this point in time there is NO formula in any column.

    I tried deleting the table and making a new table with the same headings (and NO formula). However, when I used my userform and table data was populated, the formula ALSO appeared.

    Any ideas on why this is occurring, and more importantly how I stop the pesky formula from appearing?

    Thanks

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: How to stop formula from appearing in VBA generated table

    Without a sample file...It is a wildcard guessing game...
    Must be reasoning in your code...
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  3. #3
    Forum Contributor
    Join Date
    01-12-2021
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    118

    Re: How to stop formula from appearing in VBA generated table

    Thanks sintek.

    I have worked out the error is because the table it is copying from has the formula in it.

    This is the current vba formula:
    T_ORIGINAL.ListColumns(1).DataBodyRange.SpecialCells(xlCellTypeVisible).Copy Destination:=T_VBA(1)

    What do I need to change in this formula so it copies the value only in the original table and not the formula?

    Thanks

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: How to stop formula from appearing in VBA generated table

    Will have to incorporate...Untested...
    T_ORIGINAL.ListColumns(1).DataBodyRange.SpecialCells(xlCellTypeVisible).Copy
    T_VBA(1).PasteSpecial xlPasteValues
    Last edited by Sintek; 10-16-2022 at 05:25 AM.

  5. #5
    Forum Contributor
    Join Date
    01-12-2021
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    118

    Re: How to stop formula from appearing in VBA generated table

    Thanks sintek. That formula works perfectly!

  6. #6
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: How to stop formula from appearing in VBA generated table

    Glad to have helped...Tx for rep +

+ 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] Stop VBA error box from appearing
    By Fjcunninghamjr in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-25-2020, 01:06 PM
  2. How can I stop the short menu appearing when I press the full stop key?
    By Sadieberg in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 06-06-2015, 07:43 AM
  3. [SOLVED] Stop #DIV/0! From Appearing
    By Muse83 in forum Excel General
    Replies: 5
    Last Post: 02-05-2015, 01:01 PM
  4. [SOLVED] How to Stop #Value appearing?
    By chapman73 in forum Excel General
    Replies: 2
    Last Post: 11-20-2012, 06:02 PM
  5. [SOLVED] How to stop reviewing bar from automatically appearing
    By ChAnDeRu in forum Excel General
    Replies: 12
    Last Post: 07-09-2005, 10:05 AM
  6. How do I stop the template help from appearing on startup
    By Allan_D_Ziegler in forum Excel General
    Replies: 0
    Last Post: 07-06-2005, 12:05 AM
  7. [SOLVED] how do I stop this appearing.......#DIV/0!
    By Scudo in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 07-02-2005, 09:05 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