Message error in Excel _how can I solve it? - excel

Can anyone tell me how can I solve the following error? I get this error every time I enter a value in my cells. This Excel has a VBA script and based on the entered values, it runs a stored procedure.
The Excel runs correct, is just that I get this message all the time.

It seems that your code tries to add or remove a row in the upper table (unfortunately you failed to show the code).
Your tables don't have the same number of columns so when adding (or removing) the row would move only a part of the lower table(s) down which would corrupt the layout.
Possible Workarounds:
Instead of inserting a table row, insert a row to the whole sheet.
Organize your data so that tables are not stacked (show the tables next to each other, not above each other)
Make sure all tables have the same number of columns.

Related

Set specific height for all existing/new rows of a table

I have used Excel for quite some time now but only using traditional formulas. Now I am trying to create a more elaborated document for my business using VBA coding to expand my possibilities.
I have done some research and started practicing but found something that I can’t understand how to do yet.
I have a worksheet with a table on it. Since this is a fresh document it has nothing but the header and a blank row below it. What I always did when writing the information was type text in any of the columns that belong to the row immediately below the table (without actually inserting a new row myself). This creates a new row for the table where most of its format is kept, such as text size and formulas. However, I noticed that the row height doesn’t automatically change to that of the previous rows of the table, and changing it manually for each new row is very time consuming.
I would really appreciate it if anyone could share me the necessary Excel VBA code to fix this issue. I have thought of two possible approaches. The first one is a code that automatically sets all the rows of the table to a height of 20 (I want all rows to be the same size so no problem with that), supposing this would also affect new rows as I add them the way I mentioned. The second one would be a code that automatically sets every new row of the table to a size of 20. It doesn’t matter which one you choose, the easiest will be just fine. Thanks in advance.

Issue with removing rows in excel table

I was working with new office web add-in for excel and manipulating the excel tables programmatically.
There are some strange situations where depending on table location it is not possible to delete the rows of the table.
For example as shown in an image below, when removing row in the first table the error is "This won't work because it would move cells in a table on your worksheet."
In cases below there is no any error, I am not sure what is wrong with first use case.
and this
It's because in the first case removing one of the rows would move part of the rows of the second table (the first two columns would move up one row). In your other cases removing the row from the first table would only move up empty cells, not affecting the other tables.

MS Access - Data in top row appears and disappears when focus on the cell changes.

Its a bit of a weird one but I have a linked table within my database. The table is an excel table with identical field headings and data types and until recently has worked fine however now when I traverse the linked table in Access the data will change every other move, changing from the original row to show data in the row below. Iv had a script output the values of the top row and it displays normally however I cant append this linked table into anything and I assume its this glitch.
Im stumped and would love any ideas as to how this happened and how it can be fixed.
This is an unusual post as I've never quite heard of this type issue. To sanity check things I would suggest that you delete your excel table from the navigation pane in Access - and then relink it.
So then perhaps I didn't understand, and I am wondering what is meant in your first post by: "The table is an excel table with identical field headings and data types"
A link to excel is a qualified "table" so to speak. You should be able to double click on it within Access, it opens in data sheet view and you see all the data but you can't write to it. You can't write back into the excel.
You can query it....
You can append the query results of the excel into a true Access table.

Excel 2010 check cells in a row contain data before the Selection Change fires

I have an Excel 2010 data table which is driven by a query from MSSQL. The underlying query changes depending upon what options the user selects in the Excel workbook. I'm okay with changing the query and pulling the data.
After the data has been selected multiple users will be able to edit and append data to the Excel table and these changes will post back to the SQL database table. Due to the database table structure some of these cells within a given row are mandatory before any data can be inserted into MSSQL and/or potentially updated.
So what I'm trying to achieve is checks on whether certain columns in a row are blank after a cell is edited (I can do this via Worksheet Change) and also before they move off that row so I can bring up a message if all mandatory columns haven't been entered. I can't see any events that fire before Selection Change. My only thoughts on a workaround is to have a global variable row marker that is updated on Selection Change, i.e. it will store the previous row number. I can't use Excel's standard data validation functionality looking at blank cells because although this is fine for a currently correctly populated row that is being edited, inserting new rows or appending directly to the bottom of the table will constantly error as all those mandatory columns will, of course, be blank. Currently I am using conditional formatting to at least highlight columns/cells that require input although this doesn't force users to actually do it. Data cannot be stored within MSSQL until these columns contain data so if they don't fill them in and refresh the table for whatever reason, whatever they have entered will be lost. Obviously this is bad, m'kay. I am concerned about both the Worksheet Change and Selection Change events constantly firing and how that will affect workbook performance.
Any suggestions would be appreciated. Maybe I'm going about this all wrong so any ideas to make this more efficient would also be well received. The user base do not want to see UserForms or MS Access even though it would make this activity very easy. They are too used to the look and feel of Excel sheets.
your best way is to copy the table into 2d array or some other data structure in memory such as dictionary or collection. and than manage each change in memory. this one is very efficient but requires a lot of code. with excel the only problem you have is the key the rest is vlookup and true false questions. vlookup will find the original value and then you have current data + previous data + the logic... is the new data ok?

Pivot Table returns wrong value on one row

I have a very strange problem. I built a macro that refreshes several PivotTables. Everything is fine except for one PivotTable where one value "AGHF21A#BFF" in the source gets changed into "54r" in the Pivot Table. Other PivotTables also get data from this source and they all get the correct value. This only happens with this specific case from a list of 30 products, this is the only one that changes the value in the Pivot Table.
I tried everything Excel would allow me do. I changed the format to string/general. I tried to do a calculated field. The strange thing is that if in the source data I add let's say any character, remove any character or change any character then the pivot table does recognize the code and does not change it to the strange code "54r." I have never seen any Pivot table do this before.
The Macro downloads different reports into Excel and then it refreshes the PivotTables. Any help would be very appreciated.

Resources