Extracting Data From 1 Sheet And Place Result Into Another In Same Workbook

Jul 16, 2013

I am working on a workbook in which I extract data from a SQL database into a sheet with more or less the following format:



The aim is to extract a list of any employee that has been tagged as "NEW" in the last column, with his/her detail as per the column headings - and place the resulting list in another sheet. The extract is done dynamically and varies from month to month. So in other words the column headings 2013.MAY and 2013.JUN will change next month to 2013.JUN and 2013.JUL respectively - and so would the detail of the data below them as well. The "NEW" tag is simply assigned through an IF statement.

I had a look at most of the Excel Magic trick video clips on YouTube and managed to get a data extract from my main data sheet - BUT was only able to do the extract on the SAME sheet and NOT onto another sheet in the same workbook.

View 3 Replies


Fill In The 3 Criteria Fields, Calculate The Result, Copy The Result, And Place It Into The Correct Place On The Table

Oct 19, 2006

I have a macro that imputs data from an external database and puts it into a temporary worksheet. This data has 3 columns (ID, Date, Amount). I am then making another sheet which has X number of tables (one for each ID), with the years being the column headings, and months being the row headings. ie.

| ID X
| +------+------+------+--->
| | 1999 | 2000 | 2001 |
| Jan | $100 | $250 | $300 |
| Feb | $200 | $300 | $200 |
| Mar | $300 | $250 | $100 |
| Sum | $600 | $800 | $600 |
| +------+------+------+--->

| ID Y
| +------+------+------+--->
| | 1999 | 2000 | 2001 |
| Jan | $100 | $250 | $300 |
| Feb | $200 | $300 | $200 |
| Mar | $300 | $250 | $100 |
| Sum | $600 | $800 | $600 |
| +------+------+------+--->

Currently I have a few hidden fields for the DSUM Criteria. I start making the tables. And then filling in table based off of the month and year. Doing so I need 3 criteria:
>= First Day of the Month
<= Last Day of the Month
= ID #

The problem is it takes Excel too long to fill in the 3 criteria fields, calculate the result, copy the result, and place it into the correct place on the table. Is there another way to get this data into the correct tables faster? Instead of using DSUM?

View 8 Replies View Related

Extract Data From Files Within The Same Directory Or Below And Place In New Workbook

May 3, 2006

Firstly, I have attached a file called test2 which has two sheets within it, one called list and one called 12345. This is for demonstration purposes only as in real life these are both separate files.

What I am trying to do is create a history in the file called list that extracts certain data from the file called 12345 and places it in a more user friendly format. No problems with the formulas etc, just a case of a few ifs and buts.

My real problem lies in the fact that file 12345 is only one of hundreds of files and in order to create the history, I have to repeat the process on all the other files, so that the list grows as I copy the data.
Again for demo purposes, the file "list" sits in the C root ie C:list and the job files sit in C:files*.*.

Is there a way to automate the process so that formulas or VBA residing in the file "list" searches through the C:files*.* and populates the list as it runs through them.

View 9 Replies View Related

Using VBA To Update Workbook B Extracting Data From Workbook A

Mar 27, 2014

In order to do the tests, I'm using 2 simplified workbooks (test_copy and test_paste).

What I'd like to be able to do, once I click a button UPLOAD (creating the button isn't the problem), is to go to the first cell from workbook test_copy, check if that code is already on test_paste and if not add it to the bottom of the list, repeating the same cycle for each code on the workbook test_copy.

The orders of the codes might change on both workbooks differently depending on the way the columns are sorted. That is why I believe that for each code in test_copy I need to check the entire column in test_paste to check if the code already exists.

At the end of the routine, on the example below, we would have the codes 2670, 2676 and 2626 added to the end of the list on test_paste.


Excel 2012



View 9 Replies View Related

Macro: Place Result Value Instead Of Formula

May 9, 2008

I am testing the code below...

Sub applyCombination()

Dim shtP As Worksheet
Dim j, k As Integer 'j = row; k = col

On Error GoTo errorhandler

Set shtP = Sheets("Sys-Year")........

k = k + 1
Next k
j = j + 2
Next j

Exit Sub

Exit Sub

End Sub

and, as it is a bit slow to paste a formula in each cell, I was wandering:

Is there any way I can place the resulting value ONLY?

(I don't want to do copy and paste special just values as it takes even more time)

View 9 Replies View Related

Lookup Data And Place Corresponding Information On Another Sheet

Jan 10, 2008

Found several items close to this, but not exactly (at least that I could find). It's difficult to type what I need to do, but here it goes.

I have two sheets. Sheet1 has data that I want to look at in range A1:B7; Sheet2 has column titles waiting on data from Sheet1. If one of the column titles on Sheet2 is "Mike," I need to look for all "Mikes" from A1:B7 and pull the data automatically onto the other sheet. I apologize if confusing, but I tried as best I could to describe it. I have attached a small file for guidance. Using the attached file, take "Mike" for example. Under his name on Sheet 2, cell A2 would display 300, then cell A3 would display 1,000.

View 9 Replies View Related

Extracting Data From Separate Workbook?

May 25, 2014

is it possible to place sheet names beside the data? What I mean is that, I'm currently working on a report which extracts data from the current workbook (many sheets) and paste it into a new workbook. As there would be duplicates due to many different sheets. I would like to have the duplicates removed but have the sheets name which they are found in the columns beside.

View 9 Replies View Related

Extracting Data From Closed Workbook

Oct 3, 2006

I'm currently facing problem with double for loop in the previous vba ,extracting data from closed book. however, it uses only one for loop to extract all data. I need to extract lots of data from the book and thats why i double looped it to extract more data. however, i can only get the first line of data i can't extract any more data from then on.

Sub RunCodeOnAllXLSFiles()
Dim lCount As Long
Dim wbResults As Workbook
Dim wbCodeBook As Workbook
Dim rCell As Range
Dim lCount2 As Long


Application. ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False

View 3 Replies View Related

Macro To Copy And Place Data To Specific Place

Feb 22, 2007

I am after a macro to do the following, my visual basic skills are very limited (non existant):- Look at the date in cell A1 on Sheet 'Live Report' and err 'remember it' Copy a range of cells from A3 to A10 on 'Live Report' Go to sheet 'Monthly Summary' and find the date that had been remembered previously (this date will be in column A on 'Monthly Summary' which will probably be a mixture of values and formulas). After the date has been found paste special and transpose the 'values only' copied range from 'Live Report' (A3 to A10) in column B on 'Monthly Summary' next to the date that has been found in Column A.

View 2 Replies View Related

Move Numerous Data To Any Favorite Place In Other Sheet Quickly ?

May 25, 2009

Let`s assume that I have numerous "Serial Number" in "Sheet1" : http://i40.tinypic.com/2iqbspt.jpg

Now I want to create some cards in "Sheet2" that each card have a serial number that related serial number there is in "Sheet1" : http://i43.tinypic.com/34fz690.jpg. Need easy solution for doing it while when I drag one card to copying it then related serial number in sheet1 would be appear in required field. I mean first card has first serial number of sheet1 and second card has second serial number of sheet 1 ; but I want to doing it quickly with dragging.

View 4 Replies View Related

Filtering And Then Extracting Filtered Data From Closed Workbook

Nov 12, 2013

I am looking for a quicker way to filter and extract data from a closed workbook. My current code opens the file and then does the necessary filtering before copying into a separate workbook, however, the workbook I am opening is huge and takes several minutes to open.

Is there any way to speed things up a bit?

Workbooks.Open Filename:= _
"T:8. CaseBlocks Data for ReportsStephanieNo_Acknowledgement_Received.csv"
ActiveSheet.Range("a:a").AutoFilter Field:=1, Criteria1:=" 10000"
ActiveSheet.Range("H:H").AutoFilter Field:=8, Criteria1:= _
ActiveSheet.Range("IJ:IJ").AutoFilter Field:=244, Criteria1:="NULL"

View 4 Replies View Related

Extracting / Transposing Sheet Data?

Mar 9, 2014

I have the attached file with two worksheets D30(1) and Sheet 2.

I need to extract some of the information contained on the D30(1) sheet into the format as contained on Sheet 2. It is almost like a transpose but because all of the information is not needed and all cells don't have info in it, I didn't even try to transpose the D30(1) info.

Is there an easy way to extract the information from sheet D30(1) to present it in the format of Sheet 2? I need to do this for approximately 50 sheets similar to D30(1). Some sheets might even have more columns than the example provided.

View 4 Replies View Related

Extracting Dates Data From The Same Sheet?

Apr 1, 2014

I'm attaching the test file with one example sheet. Within the same sheet, there is month end dates in column A, and from column B till column E, there are 4 variables (Foreign LT Debt, Local LT Debt,Foeign ST Debt and Local ST Debt). Their respective month end values are already given from column G till Column R. How it is going to be extracted is that against each effective date for that variable (Foreign LT debt, for example), the Rating is given under Rating header. So, for instance, for Foreign LT debt, rating from 25/8/1993 till 4/2/1997 is BB-. So, for all CELLS in column B between these dates, the rating should be BB-. Before that, since there is no value given, I want to put it NA. I have filled the values in column B for demonstration. I want to write a function or perhaps a macro to do that automatically for these 4 variables. There are 50 + sheets with the same layout, so I hope the macro or look up function have not to be written 50+ times.

View 1 Replies View Related

Protecting Data When Extracting From Another Sheet

Feb 17, 2010

I need is for the Roster sheet, which has the exact same column and row headings as the Leave sheet, to read the data from the Leave sheet and change dynamically if the Leave sheet is changed. If there is data in any cell then I need to protect just that cell in the Roster sheet so that the user creating the staff roster is unable to edit it out.

I have created a plain cut and paste macro on open from Leave to Roster but this doesn't give me the dynamic linking, and doesnt help solve the problem of needing to check each and every cell in Roster against a corresponding cell in Leave, but also if its blank in Leave to allow the user to update that cell in the Roster sheet.

View 3 Replies View Related

Extracting Matching Data From Two Sheets Into Third Sheet?

Jan 17, 2014

I'm not sure if this is best handled in the Formulas & Functions section or elsewhere, but this is my best guess. I have a spreadsheet used for tracking hardware issues with data in two worksheets:

1. PageCount
Column 1: Date
Column 2: Serial#
Column 3: PageCount

2. Tickets
Column 1: Date
Column 2: Serial#
Column 3: TicketNumber

What I'm trying to do is find a way to extract from those two sheets the date, serial number, page count, and ticket number where the date / serial # are the same and dump this to a new sheet. I've thought that I may need to concatenate the date / serial number together into a single cell or something, but I'm really at a loss as to how to pull this data. Part of me thinks this should be done in SQL, not a spreadsheet, but that's how our reports are produced.

View 1 Replies View Related

Extracting Data In One Cell And Populating Another Sheet?

Apr 26, 2013

I want to create a sort of complex logging system for my work.

As of right now i use a simple temple. Column A has the job number, column B has drawing numbers. Each cell in column B has multiple drawings. So for example cell B2 might contain 101, 102, 103, 104 and so on or something like 101...104. Depending on the situation. The ... means drawings 101 thru 104. What i want to do is have a second sheet that has Column A be the job number but column B has just one drawing #, so an example would be . A1 = 10939 and B1 = 105, 107, 109..111. Sheet 2 would then have A1 = 10939, B1 = 105, A2 = 10939, B2 = 107, A3 = 10939, B3 = 109, A4 = 10939, B4 = 110, and so on. Is something like this possible.

View 4 Replies View Related

VBA Macro - Formula Extracting Data And Transpose Into Another Sheet

Feb 3, 2014

Extract data from one sheet to another sheet then transpose automatically.

I have attached the work book of what I'm trying to accomplish.

View 14 Replies View Related

Extracting Similar Data From Different Worksheets And Displaying On One Sheet?

Apr 13, 2012

I have two work sheets as-



Sheet 2

nameschooldate of admission
abcpublic school2/9/2011
efgpublic school3/4/2010
hijprivate school5/9/2011
klmprivate school8/9/2011
mnoprivate school9/10/2011

now what i want is - on sheet 3 compiled data as-

idnameclassscoresschooldate of formation

View 1 Replies View Related

Excel 2003 :: Extracting Sub Sheet Of Data From Larger Schedule

Dec 31, 2013

I have sheet containing a schedule of data. It is a record of changes on a project, each change is sequentially numbered and contains a row of data (date of change, whether approved, cost of change etc). Each change is given a cost centre reference (1 of 10 cost centres are being used) depending on the type of change being made.

I need to keep that record of the overall schedule of changes but I also want to extract each of the cost centre categories into a sub table on the sheet to give a schedule of changes against each category.

I have almost achieved what I want but one method leaves blanks in the sub table which I want to avoid and the other method I used to remove the blank lines but needs the first method sheet calculated before it then goes to work and seems rather cumbersome and I suspect there is a much easier method. (I also want it to be compatible with excel 2003 so it can be used across several platforms.)

View 7 Replies View Related

Extracting Data And Posting In Another Sheet Based Upon Macro Selection

Mar 9, 2009

I have written basic macros (probably not the most efficient solution, but its what I know how to do). Up to the present point things are going well. (I tried to attach file, but without success - So I will email the file directly it is pretty easy to figure out) I have option buttons tied to macros that populate a data sheet based upon the input.

This works out quite well and I am able to generate the statistics I desire quite easily. Now comes the second phase, (this is where I am stuck) - when I click the option button "no", I would like this to generate a line item in a separate existing worksheet which lists the item number, tells the discrepancy (as written in the column on the inspection criteria sheet), has a text field for the inspector to briefly explain the exact nature of the discrepancy, and also keeps discrepancies in proper order. Conversly, if "yes" is selected, I would like to be able to check the associated comment page, search the page for that discrepancy number, and if found, delete the line item, then re-oder the page.

View 8 Replies View Related

Excel 2010 :: Cross Checking Info With VLookup And Extracting Data From Sheet

May 9, 2014

So in my excel document I have it such that on the first sheet (Labeled 'Sorted') the data is set up as follows: LOCATION, EXTENSION, NAMEWith the appropriate data under each header. On the second sheet (Labeled 'Locations_Ext') I have a named range called Locations; it contains extensions from a separate document, names of people associated with the extensions from the document, and their locations on the map. I am trying to have it such that the excel matches the extension number given on the first sheet with the ones that I extracted from the document on the second and output the location into the first column on the first sheet. The code I have set up for that process is:


I then want the excel to cross check the information that I took from the Visio to see if the visio is up to date with the latest info we have received (Which is the data on the first page under Extension and Name). The code:


Both codes seem to be giving me this: #N/A as the results for every cell.. I'm using MS 2010

View 2 Replies View Related

Check Data From Two Sheets And Result On Third Sheet

Jul 3, 2014

I have excel file, consists of 4 sheets Data, PF, Gratuity, Discrepancy. Here I have Emp no. field as key field, now here first I have to check Data Sheet data with PF.

For example,

Suppose, we are considering Emp no.: 4 from data sheet. It will check in PF sheet for same Emp no. if it find then it will check the relationship and first name and last name from data sheet. If it is ok then it will return output in discrepancy sheet with OK. Discrepancy sheet format:

Emp No. Spouse Child1 Child2 Father
(All the relationship present in Data Sheet in Column)

4 OK

And so on.

View 8 Replies View Related

Print Result Cards Automatically From Result Sheet

Apr 25, 2014

I have excel result sheet which contains students information. i.e. name, subjects and their corresponding marks, grade, percentage etc. So from that sheet I want to print result cards for each students separately from the data (result sheet).

View 4 Replies View Related

Copying Data From One Workbook Sheet To Another Workbook Sheet Without Overwriting

Jul 1, 2014

The two sheets are...

1. Sheet1.xlsx (regular excel sheet as the extension is .xlsx)

2. Consolidated.xlsm (macro enabled sheet as its extension is .xlsm)

1. Copy both the files on your system under a particular folder.

2. Now make 9 replica's of Sheet1.xlsx and name them as Sheet2, Sheet3, Sheet4, .......... Sheet10

3. Open the sheet Consolidated.xlsm and see the button i have added called "Pull Data".

Now write down the code by adding a Module in that excel sheet from the code window.

4. Write a code that will open each of these sheets (Sheet1, Sheet2, Sheet3, Sheet4, .......... so on) one at a time and will copy the data from these sheets to the Consolidated.xlsm sheet.

5. Make sure that the data is appended(and not overwritten) from the multiple sheets (Sheet1, Sheet2, Sheet3). that is once you paste the data from sheet1 to Consolidated.xlsm then the Sheet2 data will be pasted at the end and after that sheet3 data will be pasted and so on..

6. In this way at the end we will have all the data from Sheet1, Sheet2, Sheet3...in the consolidated sheet.

7. The Division column in the Consolidated sheet will have the value of first row in these multiple sheets. So after making the replicas of Sheet1, please change the value in first row (Range A1) to any other value to avoid the confusion.

8. I have highlighted the data for two sheets in yellow and grey color in the consolidated sheet.

View 8 Replies View Related

Extracting Data From File In Directory And Extracting Filename

Mar 20, 2014

I have a directory folder with an active workbook and another workbook id like to copy data from. The Following macro opens up a file in the same directory, copies some data and pastes it in the active workbook. However with this code I have to specify the filename, 'Data.xlsm' in the example code. I would like it to copy data from the only other workbook in the current directory WITHOUT having to specify the name in the code, so just opening it up no matter what filename it has.

In addition I would like to extract the filename from the workbook im copying data from and paste it into the activewoorkbook in sheet 1 Cell A1. I had a look at getopenfilename function but cant seem to make it work for my purpose.

View 4 Replies View Related

Advanced Filter Placing The Result (the Filtered Data) In Another Sheet

May 29, 2006

Is there any way to use Advanced Filter placing the result (the filtered data) in another sheet??? I have tried but with no success... An error message is displayed (something like "It's not possible copy filtered data from a sheet to another").

View 4 Replies View Related

Extracting Information From A Workbook And Saving Into A Separate Workbook

Feb 21, 2014

i have a workbook blank template for my colleagues to fill in, they fill in this blank template and save it under the serial number of the item they are creating. However a lot of errors exist when they input the serial number inside the workbook where the serial number is a duplicate of a former serial number.

Anyhow i was wondering is there any way when they input the serial number into the worksheet that i could get it to save in a separate workbook and then have conditional formatting to check those serial numbers in the workbook to see if they match?

View 4 Replies View Related

Loop Through Each Sheet And Place Value Of Sum On Its Respective Sheet In Same Position

Nov 1, 2013

How can i get this code to run through each sheet and place the value of the sum on its respective sheet in the same positon .....

Sub maths()
lr = Cells(Rows.Count, "E").End(xlUp).Row
Range("E" & lr + 1).Select
ActiveCell.Formula = Application.WorksheetFunction.Sum(Range("E2:E" & lr))
Selection.NumberFormat = "[h]:mm:ss"
End Sub

View 1 Replies View Related

Macro To Transfer All Data From One Workbook To Specific Sheet In Another Workbook

Feb 23, 2014

I have data in 2 different workbooks, and I need to transfer all data in 'Jx_ex1' to sheet1 in the 'template' workbook, and all data in 'Gr_ex1' to sheet2 in 'template' workbook. All data should be transferred to the same cell numbers, from A1 to Y5000. I actually have loads of workbooks to transfer to the template but if I have an example with the two then im sure I can work out how to modify it. All files will be in the same folder.

View 8 Replies View Related

Will VBA In Place Of A Function Reduce This Workbook Size

Mar 5, 2009

I know that VBA doesn't always slim down workbook size and calculations are calculations whether in VBA or Formula format; but in this instance, do you think VBA would be a better choice? This workbook is currently enormous in size and slow, and I think I can slim it down if I used the right VBA procedures. However, Im not certain what those procedures would be.

On two seperate worksheets in a workbook, I have a column that contains a formula that references a third sheet.

Sheet 1 = "Order"
Sheet 2 = "Turn-in"
Sheet 3 = "Bank"

Ok, here's the scenario: On the "Order" sheet, I have a list of orders from my company; on the "turn-In" sheet, a list of turn-ins. The "Bank" sheet lists ALL transactions (ORDER AND TURN-IN).

On both the turn-in and Order sheets, the formula is pretty much the same; it references a different column on the bank sheet, but does it the exact same way. Ok... The Order sheet lists all order from the company by order number (column A); the formula uses that order number and finds the transaction on the "Bank" sheet and returns the order cost as the result. however, the order numbers on the bank sheet have a 5 digit prefix on them (the prefix is the same on all orders, its used by the bank but only orders with my 5 digit prefix are on the list sent to me and pasted to this sheet. So all orders on bank sheet have the same prefix)

The below formula is in Cell C10 on "Order" Sheet; Column C lists the Cost reported by the bank. The formula below references the Bank sheet database, looks for an order number that matches the order number in A10 (Adding the prefix of course), and returns a cooresponding cost for that transaction.


I know this seems long for what it is, but it has to add the prefix, and then match the order number, and reference the cooresponding cost.

The kicker, this forumla is in more than 10,000 cells; 6,000 on the order sheet, and 5,000 on the turn-in sheet. Of course the references are a little different, but the principle is the same for all of them.

Is there a way to do this in VBA to save space and resources? This formula is really dragging.

View 9 Replies View Related

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