Update excel from access shuffles rows - excel

We have an access 2003 database and an excel 2003. We connected the excel to import the data from the access, so far so good.
At the end of the imported data right to the next 3 fields of the excel we want to add some comments, text.
Up to here all work fine, but when we update the data to excel the rows shuffle and the comments at the right columns remain at the same row. So the data rows shuffle and the comment rows remain at the same position.
So if row 3 has at the right the comment 3, when we update the worksheet to retrieve the new data from access it replaces row 3 with data from another row but the comment remains at row 3.
Is there a way for the excel to keep the imported data to the same position and not shuffling it?
We tried all the options at excel "What to do when new lines of data are available" but all do the same, it shuffles the data when we update, even if access has no new data.
Thank you in advance.

I think you will find that when you imported data from Access, Excel created/named a range called 'database' or 'data' or something like that. You need to expand that definition to include the added columns.

Related

Why is some table header data missing when I import with Excel's "Data Connection"

I have a workbook that needs to connect to two other workbooks to pull data and summarize it.
I have set up a data connection, but on one of the sheets, when the data is imported, some of the table headings are missing (The cell where the heading would be is empty, although the layout and format of the data seems intact).
The two workbooks are housed on a shared network folder, and are updated remotely by other teams. Because the workbooks are updated regularly, I can't run this macro right in the workbooks
The intention of the sheet is to collect data from both sources, and summarize it on a per-agent basis, with some items like bonus qualifiers, attendance, productivity, etc., and then be able to print the individual sheet as a PDF and send to the agent.
My first data connection (Breakdown by business line) initially was missing the 2nd column header from the original workbook. The source table was a pivot table with a slicer that could hide some columns. No matter how I manipulated the source sheet, only the 2nd column was missing data. I corrected this by removing the data connection and creating a new one with "First Row Contains Column Headers" un-checked
My second data connection (Attendance & performance), I am missing headers for columns 3, 4, 5, and 9-13 (1, 2, 6, 7, 8 all display).
The source table for this is a pivot table, but there is no slicer for the columns (they are static).
I've tried both checking and un-checking the "table headers" box. If I check it, I have NO column headers, but un-checked gives the result stated above.
What I'd like to know is: is there a reason for this, or something I can do to change this? Since the headers on this second file are static, I realistically can operate without them since I know what they will be when I create the VBA code, but for future-proofing I wanted to be able to adjust to any changes on the fly without having to edit the code.
As a new user I don't have the reputation to post images, but I've linked to the images here:
This is a sample of my source table:
This is what I get when I connect with "Data Connection"
I expected that when I imported from a table, all data would transfer over, but I seem to be missing only the table headers, for some reason.
In case anyone else comes across this, I think I found the solution. There's an ODBC Limitation when a column has mixed data modes. Because my headings were text but all of the data was numerical (a double data type), the query returns NULL for the text fields and ignores them on my table.
The IMEX setting fixes this. Setting IMEX=1 in the Extended Properties allows for mixed data types.
Example:
Extended Properties="HDR=Yes;IMEX=1;"
For me, this didn't fix my issue on its own. When I deleted my table, changed the connection property, and then created a new table from existing connection, everything imported as it should.
Hopefully someone else finds this useful one day.

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?

Excel : Selecting data and keeping it up to date

Ugh,
I'm not a hero when it comes to Excel...
I have an Excel file with one sheet that contains all data. It's basically a list of tickets, displaying the ticket ID, type, value and 5 dates per row.
I'm looking for a way to have new sheets in the Excel that actually display only tickets of a specific type. So on the sheet Bug Tickets I want to diplay like a filtered sub-set of the raw data in the first sheet.
However, this new sheet needs to refresh it's data automatically when I add new data to the main list.
Is this possible in Excel?
Ok here is a way using a Pivot Tables and Tables.
You should set it up like below: (in the SS, I put the pivot in the same sheet but you can put it in another).
Steps:
You need to create a table out of your data. See here on how to do it.
Then create a Pivot Table out of your table. See here on how to do it
After that you just need to format it the way you want.
The Pivot table will update everytime you add data on your table.
It will display what you've filtered.(in my example I filtered type A).
Notice: Apologies I cannot create a step by step procedure for you(very tedious). I wouldn't have posted this as answer if only it would fit as comment.

Import data from excel sheet with new columns in CRM 2013 Online

I previously imported data from an excel sheet into CRM that had around a dozen columns in it. At that time some of those columns were empty. Now that excel sheet has been updated to include values in those previously empty columns.
How do I import only those newly updated columns in excel sheet to update their respective CRM records? Is their a way of importing them without creating duplicates and anyway messing up the records in CRM?
One to do would be to run an advanced find with the new columns plus any columns that you would need to identify the rows. Next, export to Excel all of the rows from the page and check the box to make the rows importable (see attached screenshot).
Finally, put the data for the columns into the appropriate columns and then import the spreadsheet.
This is probably the best way to update existing records through the data import utility.
As long as the data being exported and added to the Excel file is under the 8 MB size limit, you could get all records exported if you marked the "Static worksheet with records from all pages in the current view" while also keeping the "Make this data available for re-importing by including required column headings" checked as seen in the screen shot in the answer here.

Stopping NULL Rows and Columns to get imported from excel to access

I am importing some table from excel to access.Sometime some blank columns also are imported as field13 or field-x .
Whats the reason for that.
Also sometimes some blank rows are imported also.Is there a way to stop it?
Below is the set of data I am trying for import. But sometimes I see an extra column after ArtSRv and and some extra empty rows after 2 row getting imported. So I want to know the reason for that.
During the import process you are given the options to not import columns (there is a checkbox). Also you can choose a primary key which can help with the blank records.
The blank records are mostly the way the data is structured in excel (or not structured as the case may be.
Excel keeps a property of the active area, and I believe Access uses this property to determine the rows/columns to import.

Resources