Only Importing Specific Spreadsheet - VBA

Sep 8, 2011

I have some code that imports an excel spreadsheet into access and creates a table. I recently received a new spreadsheet that has many sheets. I only need the data from one specific sheet, resources. How can I make adjustments to the code below so that only the data on the resources sheet is imported into a new table?

Code:
Option Explicit
Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias _
"GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Private Type OPENFILENAME

[Code] ....

View Replies


ADVERTISEMENT

Exporting To A Specific Excel Spreadsheet, And A Specific Worksheet/cells

Oct 6, 2005

Hi,

I have recently been doing a lot of work on this area. Im able to export to where i want to and run macros through the VBA code inside of Access to edit the spreadsheets. This is ok if your making a new excel workbook/worksheet.

But what im stuck on is exporting to a so called template in excel. I can export to it at the moment but creating a new worksheet, in which i have to then cut and paste the data into the correct worksheets through code and then delete the worksheet that i had been working from (which is annoying because you have to confirm the deletion of this worksheet, which is why i couldnt really do the process this way).

What i want to know is there a specific way of telling the data you are exporting from a table/query/querydef to go into a certain worksheet and into a certain cell. For example; a list of names, i want all the Surnames to go into a worksheet called "Claim_Breakdown" and start from cell "A15" downwards until they have all been exported into the worksheet.

Anyone have any ideas on how i could achieve this? Thanks.

View 4 Replies View Related

Importing An Excel Spreadsheet

Nov 29, 2005

Hello Peeps,

I'm trying to import an excel spreadsheet into an access table. The excell spreadsheet was created using the access table( by using the 'analyze using excel' feature)

The problem is that I cannot import the updated excell spreadsheet. I get the error message.." An error occured while trying to import the file..the file was not imported"

Does someone have any clues as to how to fix this

View 1 Replies View Related

Importing Spreadsheet Data

Sep 5, 2005

i have to import sales figures from a branch to head office. the import facility in ms access 2.0 only allow for 1 table although the data that needs to be imported needs to be done into two tables. how would i be able to do that appending the data to a query already setup to bring in the data. it is just to import the data from the spreadsheet to the two different tables.

thanks melanie

View 2 Replies View Related

Importing A Spreadsheet Using A Dialog Box

Jun 23, 2007

I know that this is possible.

I need to import a spreadsheet via a button, I don't know the name of the sheet nor the location. I need to have the open dialog box appear. I tried the import code which will not work without a name and location.

DoCmd.TransferSpreadsheet acImport, 8, "GoldenViewIn", " ", True, ""

Help

View 2 Replies View Related

Importing Flat Spreadsheet Into Normalized DB

Nov 29, 2004

So I’ve been assigned to develop a database in Access which will house information on students who are participating in an internship program sponsored by my employer. I was given a spreadsheet with roughly 40 columns, so it is pretty detailed info about the students. For example personal student info (DOB, email, phone, etc), as well as school, major, year rank, school address, permanent address, etc.

Importing this given table is easy, just by using the import wizard. However I am faced with a challenge. The info I have is up to date at this point however in years to come there will be a need to import new student info. The only way my employer wants that to be done is by taking the new excel spreadsheet and importing that data into the already created database. Now this wouldn't be a problem if the DB is one flat, non-normalized, table because the columns would line up. However I feel that the DB needs to be normalized because of the vast amount of data that is repetitive, such as State or Major.

Is there a way to import an excel sheet into an existing normalized access database? Or even a way to automate it so that the excel columns would be broken up into the separate corresponding normalized tables?

Thanks!

View 1 Replies View Related

Importing A Sheet From A Excel Spreadsheet

Dec 29, 2005

Hi

I'm trying to import a sheet from a excel spreadsheet.

this is my "code"

The problem is that when i hit the run button, it imports blank sheets or more likely is not importing at all :confused: :(

On Error GoTo ErrorTrap
Dim dlgOpen2 As FileDialog
Dim countrystring2 As String

Set dlgOpen2 = Application.FileDialog(msoFileDialogFilePicker)

With dlgOpen2


If txtFile2 <> "" Then
.InitialFileName = txtFile2
countrystring2 = txtFile2 & "!RB_UPDATES"
Else
.InitialFileName = CurrentProject.Path
End If
.AllowMultiSelect = False
.Show
End With
If dlgOpen2.SelectedItems.Count <> 0 Then
txtFile2 = dlgOpen2.SelectedItems(1)
End If
Exit Sub

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "RB_UPDATES", countrystring2, True

ErrorTrap:
MsgBox Err.Description, vbExclamation + vbOKOnly
End Sub

View 1 Replies View Related

Tables :: Importing Spreadsheet - How To Convert Data To PK / FK

Mar 14, 2013

I have a spreadsheet of generators with associated data: Make, Model, etc.

When I build the tables for the Make, each make will have it's own PK. Is there a good way to update the spreadsheet, replacing the Make for the PK other than using the find and replace function in excel (or update query in Access).

Example:

tblGeneratorMake
GeneratorID (PK)
GeneratorMake

John Deere has PK of 1
Kohler has PK of 2

If my spreadsheet has a list of Kohler generators, I need to change "Kohler" to "2".

View 14 Replies View Related

Importing Excel Spreadsheet Into Access 2010

Dec 9, 2014

I have a spreadsheet that I'd like to import into Access 2010 however prior to the import, I'd like to delete some of the rows in the spreadsheet.The spreadsheet only has one workbook.It will likely always be rows 1-10.I have already set up the Excel 14.0 Object reference, if that's even necessaryHow can I accomplish this using either VB or query?

View 2 Replies View Related

Importing Data From A Spreadsheet To Existing Multiple Tables

May 30, 2006

First off, its been a long time since I have been here (since sometime in 2003 LOL), partly because I didn't have to create a new db in a while. Now, I have been handed a project and come across something new.

OK, here is what I want to do. I would like to be able to dump data from an Excel file into existing Access tables (two to be more specific). Now, I also have relating tables that add data into certain fields. I tried using a query to try to group data ad hopeful able to dump data through the query. I noticed that I couldn't import data through a query. Just for kicks, I tried to pull data through table and noticed that I can only create a new table, not able to update and existing table.

How would I go about performing this task? I have never attempted anything in the past.

Thank you in advance for your considered help,

Steve

View 3 Replies View Related

Importing Excel Spreadsheet To Access Database Daily

Jun 1, 2006

I need some help on this one. :confused: I have two Crystal Report generated Excel spreadsheets that are auto-updated on a daily basis. One spreadsheet contains computer assets, type, model, locations, etc. The second spreadsheet has users assigned to them, phone numbers, etc. I need to import these in to existing tables with numerous filters into my Access database weekly. They don’t change a whole lot but I need the changes to be reflected in my database.

The way I have it setup now is through a linked table, then I use a “Make table query” to filter the data.

My problem is the filtered table has relationships set up that I have to delete then recreate every time I need to run the “Make table query” because it has to delete the old table first.

Is there a better way to make this happen?

View 2 Replies View Related

Tables :: Importing Excel Spreadsheet With Empty Rows

Oct 31, 2012

I am using Access 2007 and we are importing an Excel spreadsheet that is received from our customer on a regular basis.When I open the Access table I see over 9,900 empty rows at the start. Following this is the actual data from the spreadsheet.Is there an import setting somewhere that would eliminate all these blank rows?

View 3 Replies View Related

Importing Data In Spreadsheet Or Table Format Directly From Clipboard?

Apr 5, 2012

I work at a hospital and I have been able to copy and paste data from a patient list into an Excel spreadsheet into a list I can customize to track patients I work with. I had a macro that would take the data copied and pasted and organize it in the way I needed it in a design that works for me.

I'm trying to convert this system to Access to give me more control over the data and to try and make the process of creating the list a little more automated. I also have an Access database for "tracking", which is required by hospital management so I was hoping I could use the patient list database to streamline the process of entering interactions into the tracking database.

I'm not sure how to get the copied and pasted patient list into an Access in a way that will let me manipulate it in Access to do what I want it to do without having to add several steps of a) pasting it into Excel, b) importing the spreadsheet into the Access database, and c) cleaning the data that ends up in the final Access table.

Is there a way to import data in a spreadsheet or table format directly from the clipboard, which would allow me to skip Excel altogether? I'm using Access and Excel 2010.

View 5 Replies View Related

Queries :: Importing Spreadsheet On Daily Basis - Detect / Remove Blank Columns

Sep 18, 2013

I am importing a spreadsheet on a daily basis that has the same columns in every time but depending on the company I am importing it for different columns will be blank and not needed each time.

What is the best way of detecting and removing blank columns.

View 3 Replies View Related

Importing Specific Excel Fields Into A Table

Nov 17, 2004

Hi all~

Does anybody know how to go about running a query or macro in Access to import specific fields from all worksheets contained in an excel workbook?

Say I have ExcelFile.xls, and it has worksheets with varying names. I want to pull fields B12, B16, B20, B24, B28 from each worksheet and create a new record in a table (one new record for each worksheet). Is there an easy way to do this other than pulling the data into a Crystal Reports pivot table or some such?

View 2 Replies View Related

Modules & VBA :: Search CSV To Find Specific Statement / Text On Specific Line?

Jul 8, 2015

how to read a specific line in a CSV file (using VBA), to see if the phrase "There are no records available." is present.

If it is present, then I'm going to do a debug.print stating that there are no records to load - and then the script will move on to the next file. If the phrase isn't present, then I'm going to upload the file to Access, parse the information, and then upload it to a CRM. (I already have the latter portion of the code up and running....I just need to account for the first part, where I can determine if the file has data or not).

The structure of the file never changes. The first row is composed of eight column headers (Post Date, Card Number, Card Type, Auth Date, Batch Date, Reference Number, Reason, Amount) and (if) the phrase "There are no records available." is present, it will show up on the second row, in the first column (under Post Date).

View 3 Replies View Related

Forms :: How To Hyperlink From Query To Specific Record In A Specific Form

Jul 23, 2013

I want to hyperlink from a query direct to the relevant record in a specific form. I have a hyperlink field in the form which shows up in the query. When clicked in the query, this hyperlinks to the form but I cannot make it select the correct record in the form.How do I get it to select the correct record?

View 3 Replies View Related

Button For Sending A Specific Row Of Information To A Specific Email Address?

Oct 8, 2015

I am trying to figure out how to make a button that sends an email to a specific email address, containing the information from 1 row.

we have rows where we put the the address, the quantity and the time interval we can collect the packages in. these information have to be send to a trucking company. I want access to send an email to the trucking company's email address, and not a whole report of all the rows, but be able to choose to send row 1,2,3 etc.

View 1 Replies View Related

Pulling Specific Data For Specific Date Range

Jul 14, 2007

so i have an interesting question and im hoping that someone can help on this one. i need to pull date from a specific table, no problem, that's written and working fine, next i need to be able to join the data from another table by a primary key, again no problem. third, i need to be able to select the date (using WHERE) for a specific date range. (i.e. i enter the date range of 01/7/2007 to 15/7/2007) and the query comes back only showing the data from that specific time, not the data from before or after. this is where my problem lies, all the entered data is being shown after entering my date range. i am going to include my SQL statement, just so you can actually see what im really talking about.

SELECT srealest.Name0, srealest.Dist1, SREpayments.Face2Pd, SREpayments.Penalty2Pd, SREpayments.[2paid], SREpayments.Face3Pd, SREpayments.Penalty3Pd, SREpayments.[3paid], SREpayments.Face4Pd, SREpayments.Penalty4Pd, SREpayments.[4paid], srealest.Map, srealest.Parcel, srealest.LeaseHold, srealest.TaxRebate1, srealest.TaxFace1, srealest.TaxPenalty1, srealest.TaxYear, srealest.BillNo, srealest.PdRebate1, srealest.PdFace1, srealest.PdPenalty1, srealest.DatePd
FROM SREpayments INNER JOIN srealest ON SREpayments.BillNo=srealest.BillNo
WHERE (((SREpayments.[2paid]) Between Forms![SD SRE]![Beginning Date] And Forms![SD SRE]![Ending Date]) Or ((SREpayments.[3paid]) Between Forms![SD SRE]![Beginning Date] And Forms![SD SRE]![Ending Date]) Or ((SREpayments.[4paid]) Between Forms![SD SRE]![Beginning Date] And Forms![SD SRE]![Ending Date])) Or (((srealest.DatePd) Between Forms![SD SRE]![Beginning Date] And Forms![SD SRE]![Ending Date]))
ORDER BY srealest.Name0;


any thoughts or ideas on how to accomplish this would be greatly appreciated!

View 2 Replies View Related

Locking A Specific Field Of A Specific Record

Oct 3, 2005

Hello, I have just spent ages doing searches and reading everything I can on locking. But, I have yet to find an answer as to how I can lock a specific field in a specific record.

e.g. Staff enter customer details, then at the end of the day the admin (me) checks it over and presses a big old button that stops them from locking certain fields in the current record only - they must still have access to the unlocked fields of the current record, and it must not lock any other records.

I'm guessing there's some VB code in the form of fieldname.lock = true, but then it locks the field throughout the whole table!

Can anyone tell me how to do this please?

View 11 Replies View Related

Forms :: Copy Specific Fields From Selected Record To Specific Fields In Subform?

Jul 9, 2015

I am new to access i have a problem which is i have made a form which contains a subform and a read only subreport, what i want is the ability to select a record in read only subreport as in the picture attached and make a button that when i press on it, it should copy the values of the itemsID field, Packing field, ContainerNo field and origin field from the selected record and then paste them in the subform below.

Also i want to add more then one item, so the when i press on another record it should paste the values below the first record.

View 12 Replies View Related

Create New Spreadsheet

Dec 29, 2005

I am trying to use the following code to export a table into a new spreadsheet that does not exist yet:

DoCmd.TransferSpreadsheet acExport, tbl_temp, "C:Spreadsheets" & rst!clientid & ".xls", True

but it won't work because the spreadsheet doesn't exist. How can I make Access create the spreadsheet?

Thanks in advance!

Vassago

View 3 Replies View Related

Transfer Spreadsheet

Jul 27, 2007

I have a database scheduled to run nightly. In this database I have a macro that runs a macro. I want one of the arguments to export "T_Update_Log" from the database to an excel file as part of it's nightly macro. When I use "Transfer Spreadsheet" in my macro, it creates a new worksheet in my excel file each night (for example: T_Update_Log1, T_Update_Log2, etc) Instead, I want it to overwrite existing one.

I have also tried "Export" command, but that throws a prompt asking if I want to overwrite the existing excel file. I cannot have any message prompts during my nightly task or else it will stop the whole process. Setting the Warnings to No does not stop this particular message prompt.

Thoughts? Thanks in advance!

View 2 Replies View Related

Import Excel Spreadsheet

Apr 20, 2005

Hello - just joined today. I hope to be of some help to other users, but am kind of a newbie.

I have an excel ss that I regularly receive which needs to go into my access DB. I set up a macro with transferspreadsheet and that works, except for one problem. I have one field which is designed as text but has data that looks like numbers as well as data that looks like text. When I run the macro, the number-like data doesn't import as text (23602012345 imports as 2.3602e+010). FYI the field in access is already defined as text. Each time I import a ss, I am appending to the existing data in the table

I have tried formatting the excel column as text with no luck. If I remove the data that truly is text in that column (ABC1287567) and leave just the 236* data, and then format the excel column as text, it seems to work fine. It just doesn't like the mixing of the data...at least it seems to me.

Any ideas to avoid manual manipulation of my excel ss before running the macro would be very helpful.

Thanks much in advance!

View 5 Replies View Related

Forms With 2 Dimensions (looking Like A Spreadsheet)

Dec 10, 2005

Hello,

I'm trying to build a personnal budget application.

I need to build a form that looks like a grid.

On the first column, you will see the different budgets elements

On the top line (headers), you should see the different months of the comming year.

I already managed to build the necessary tables (with 2 keys in the table source for the form).

My questions are the following:

1) how can I build a forms that looks like a spreadsheet, proposing me every cells from the start (not only the cells that i have filled before)?

2) how can I make for this form to be dynamic ? This means that, if I add a budget element in the budget elements table, how can I make the form to be adapted automatically, adding a line under the others, for every months?

I have asked severall other forums, no one could answer me.

thanks for your help.

Stephane

View 3 Replies View Related

View Spreadsheet Via Form

Jan 31, 2006

Hello all,

Thanks for your kind responses.

I have another question and hope you can help with.

On my form which gets informaiton from a query, I have among other fields an Account field. I have a query, Details, that provides details on the account field, the fields of the query include Account, invoices #s, invoice amounts e.t.c.

I would like to create a button on the form that would
1) take the account # showing on the current form and run the details query based on that account #
2) display the results of the query in a spreadsheet.

Thanks again for your kind help.

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved