Import Columns Based On Row Headers And Matching
Jul 9, 2012
I have a nice little code which imports data from a mastersheet to my input sheet. Though it will only work as long as the mastersheet is static.
I'm trying to match the product code in column A between my mastersheet and my workbook with a input sheet. And then copy the cell value in column D and E of the relevant row.
The messy part is that some of the products are split into sub categories (less than :$$$:, between :$$$: etc) and they dont have any info in column A.
I'm unsure if this is doable. Is it? And if I get permission to edit the mastersheet somewhat.
I tossed in the start of my currect static c/p, thought I don't think I'm keeping it if I get a handle on this match macro issue.
Code:
Dim ws As Worksheet, wb As Workbook, t As Date, wb1 As Workbook, wb2 As Workbook, wbName As String, janei As String, spm As String
Dim fil
Set wb1 = ActiveWorkbook
ChDir ""
[Code] .........
View 2 Replies
ADVERTISEMENT
Aug 17, 2010
I am about to re write my vba project as I can see that I need to make it more robust. One of the main issues I have is that the source XML file is not controlled by me. The quality and content is consistent but sometimes the order of the columns is different. At the moment that totally throws out my macro as it relies on certain columns for certain functions.
Trying to nut out the best way to import an XML file, keep only the specific columns I want - by content not location so then all follow on formula's will work and reference the correct data.
I have one theory that I can't get going. I thought if using defined names based on column headers this would allow me to keep and sort the columns I want. I can't find any examples to support this. I have been looking at the advanced filter but most examples reference exact cells which isn't flexible and leaves open to wrong data being pulled. Since I can't control the source doc what can I do?
View 1 Replies
View Related
Mar 8, 2014
I have a few text files and i want to import them into excel using VBA. I am herewith attaching the sample text file and the desired output file.
View 14 Replies
View Related
Feb 7, 2014
I have a DATA sheet that is all of the information reported on a monthly basis. This format will never change, but the data will. I have a second sheet called MMUSAGE.
On the MMUSAGE tab, I have identified which headers (in red) from the DATA tab that correspond with the headers in the MMUSAGE tab. Question is: how do I move the data from the DATA tab over to the MMUSAGE tab under the appropriate headers?
Example: IF Product Number on Worksheet(DATA) = Product Code on Worksheet(MMUSAGE) then move all data to Column L.
View 4 Replies
View Related
Apr 2, 2014
Essentially I want to show how many loans funded in October 2013, from ABC Lending, and I want that result to show in cell K9 of the Sample Output sheet. However, since I'm dealing with filtered data, I cannot figure out the correct combination of formulas to make this happen (e.g., SUBTOTAL, VLOOKUP).
Specifically, I'm stuck with the combination of a) counting the results that meet the monthly date criteria, combined with b) the filtered results. The single cell that I want to solve is K9, on the attached "Sample Output" sheet. Once I see how this cell works, I can figure out the rest. This cell is looking for the number of loans that funded in October 2013, from ABC Lending.
The filtered results are located on the "SCORE Data" sheet. The filter is already configured to only show results for ABC Lending, and the relevant column is labeled "Funded" (column "I"). Since the "Sample Output" sheet is looking for loans that funded in that month, and not a specific date, I created column "U" on the "SCORE Data" sheet, to convert specific day-dates to month-dates.
View 3 Replies
View Related
Feb 15, 2010
I would like to write a macro that automatically hides columns of data
based on the value of a cell (I2) with a picklist. Cell I2's picklist is
monthly values (formatted as Jan-10 though Dec-10 but real values are
1/1/2010 through 12/1/2010). I have a range that contains work week end date
values (1/8/2010 to 12/31/2010) in L6:BK6. I would like to have the macro
hide columns that are less than date value chosen in I2.....
View 3 Replies
View Related
Dec 27, 2012
I am trying to created a spreadsheet for work where I have created to validation drop down boxes, one each box has been selected i want it to return back with the correct answer in the 3rd column.
below are the 3 colums. i have created a validation for column 1 and 2 but when selected i want the final box to = column 3 ie. >=9, =2
120%
12
>=2
130%
13
>=2
140%
[code].....
View 9 Replies
View Related
May 26, 2009
Is there a way to print my columns headers in every page?
Everytime I have to print my spread sheet, I always have to keep page#1 in hands, because I cannot remember the headings.
View 2 Replies
View Related
Aug 26, 2013
I am trying to create a macro that will create a new workbook, copy certain columns to the new workbook and add new headersEaxample is:
In workbook 1 copy columns A To Workbook 2 Coumn D
BTo Workbook 2 Coumn F
CTo Workbook 2 Coumn O
Also add headings to the Columns in workbook 2
D=Name
F=Amount
O=Date
And last populate some columns with text all the way down tothe last row that contains text in workbook 2. A = Y
B= 5
C= Pass
View 3 Replies
View Related
Aug 25, 2007
Im creating a cash reconciliation application for a BUS operator client that has 6 depots and 1500 drivers.
each driver is uniquely identified by a special number.
long story short, I get 2 workbooks (named Cash1 & Cash2) that I need to have imported by driver number in my main cash rec workbook named Cashrec.
for example; ...
View 9 Replies
View Related
Mar 9, 2014
I have a table similar to the table on the left, and I need to convert it to something like what is on the right. Ultimately I will concatenate the numbers in the table on the right too with commas between, so if for some reason it's easier to go straight to that, that's an option.
So in the example below, states will be listed multiple times with a unique number next to it each time. The state may be listed up to say ten times or as little as one. Each time it is listed, it will have a different number next to it. I need to reformat this into one where each state is only listed once, and each possible number is next to it in one row.
20z3fwk.jpg
View 4 Replies
View Related
Oct 17, 2009
I'm currently faced with a spreadsheet that has data formatted like this:
A
1 RandomRowofData1
2 RandomRowofData2
3 RandomRowofData3
4 RandomRowofData4
5 RandomRowofData5
6 RandomRowofData6
7 RandomRowofData7
8 RandomRowofData8
9 RandomRowofData9
Every 9 rows, a new "set" of data repeats itself (wow, this is so hard to put into words)....
I need to figure out a way to get the data in column "A", every 9 rows, to transpose itself into 9 separate columns.
View 4 Replies
View Related
Jul 16, 2012
I have a a client who sends me an excel workbook quarterly. There are 90 worksheets and each has 20 language columns which are suppose to be the same on each worksheet.
My Problem is I want to merge them into one worksheet so i can add them to a database, but the client keeps changing the order of the languages!
So as an example I need to be able to identify the Polish, Russian and English columns on every worksheet and then combine each language to a new column on a new worksheet.
View 9 Replies
View Related
Mar 4, 2013
I have a small sample table that replicates what I am trying to do
A
B
C
D
E
1
Bob
Jim
Mary
Sue
[Code] ........
I would like to have excel put in compile the list of members on Teams 1 through 4. So in A7 through A10, I will put the teams and then in the B column I want the compiled list seperated by commas for each team so that they read like this...
Team 1: Bob, Jim, Mary, Sue
Team 2: Bob, Jim, Sue
Team 3: Bob, Mary
Team 4: Bob, Sue.
Of course this should be dynamic so that if I place an x in C4, then Team 3 would read as Team 3: Bob, Jim, Mary.
I have tried various index match offset combinations and did not have any success.
View 3 Replies
View Related
Apr 24, 2014
Ceating a macro to perform a look up and return based on column headers.
General Synopsis: Using a call and parameters to choose a lookup column and return column, and their respective sheets. Then the sub routine finding their respective column headers and perform a lookup/return. Essentially the current problem is the macro runs to slowly.
Link to original post: Lookup Macro based on column headers
View 1 Replies
View Related
Jun 12, 2014
I've done some searching and cannot find the right answer for my question. I need to create a formula that will pull column header text data based on cells within a table that contain a numeric value not equal to zero. The catch is that I cannot use any one specific numeric value as the basis for a Lookup.
I've attached an example spreadsheet for reference. Basically, I need two formulas:
1. Formula to pull column header (Receiver name) based on Sender. This is a necessity.
2. Formula to pull individual lines for those senders that have multiple receivers (Division D in my example).
My actual data file has 80+ senders and 100+ receivers.
View 6 Replies
View Related
Jun 7, 2014
I have a userform with two listboxes in them, i have set the columns in the listbox to 9 and would like to populate the column headers in the listboxes with the column header of one of the sheets.
View 5 Replies
View Related
Jan 28, 2010
I have a cell (A1) that contains text.
That text will match a single value in a reference list (i.e. range of cells e.g. Z1:Z26).
When the match occurs (e.g. A1 = Z16), I want the format of the reference cell (fill color, text color) to apply to the cell of interest (A1).
The reference cells are manually formatted.
I know that I could create a long list of conditional format formulas instead of using the reference, but it seems that there must be some way to tell excel: if the cell value contents are equivalent, the formatting should be as well.
View 9 Replies
View Related
Apr 24, 2013
i need to match 2 columns on one worksheet with 2 columns on another.
One column is alphanumerical (Reference Numbers), the other is company names.
I need to ensure that both the Reference and Company name match from one sheet, with the company and reference from another.
e.g if A1 and B1 on Wks 1 = A1 and B1 on Wks 2 = TRUE, anything else is FALSE.
There is likely to be Reference number and Comapny name duplicates, therefore the trick is to ensure that the number of duplicates match?(I.E ABC Company, Reference number 1234 may appear 5 times on worksheet 1, however if it is only on Worksheet 2 4 times, then this must be flagged).
View 5 Replies
View Related
Jul 18, 2013
I use text to columns everyday at work. Each report that I insert is in the exact same formatting and spacing. So, I open the text file, and manually enter line breaks each time. Is there a way to import text into an already broken up table? Or a way to open a file and it recognizes where to break up the lines without me having to manually click them in each time?
View 4 Replies
View Related
Apr 21, 2014
I want to import one worksheet from different workbooks to Master workbook. In the source workbook, I need to import only ' Code' sheet and in this code sheet , I need only 4 columns(A, E, F, and I ) to import. I also need cell C3and E3 in source worksheet to master workbook
I want to import like 'Code(1), Code(2), Code(3),, and so on. I don't want to import whole thing in the one sheet in the master workbook.
IN the master workbook, the header is on A3, so starting row will be row 4 in master workbook.
Codes below is for 'stacked' style, I guess.
[Code] .....
View 8 Replies
View Related
Jan 29, 2008
I've made the mistake of building an online survey without regard for the number of questions and how that might relate to import. (Excel gives the error, "File Not Completely Loaded.") As a result, I have a .csv raw data file which exceeds the number of columns in Excel's upper limit. Would anyone know of a utility that will break that file into sections so it can be manipulated in Excel?
View 3 Replies
View Related
Jan 12, 2008
i have five different formats of data files i.e. different columns in count as well as heading. i want to import selected six columns from every file in a single sheet for data manipulation. can this be done anyways. The format for result file is standard with six columns only.
View 4 Replies
View Related
Aug 10, 2013
I can't figure out how to delete the attached files that are irrelevant and I can't figure out how to upload new ones. I also don't know how to word what I need to happen
I want the data from everything, starting from row 5 and going to row 100, and not include column B or E.
How do I grab just that data? I have different formulas in each document. This is for invoicing, so the columns with the $ numbers can't be changed and I haven't been able to figure out how to not overwrite them when importing another spreadsheet.
View 4 Replies
View Related
May 24, 2014
In Excel, we have multiple images for duplicate subjects: But when imported into Access, we run into a major problem:
How it is currently laid out in Excel:
Subject 1
Image 1.jpg
Subject 1
Image 2.jpg
[Code]...
How Access requires it in order to do what we need:
Subject 1
Image 1.jpg
Image 2.jpg
Image 3.jpg
[Code]...
Duplicate rows vary from 2 to 15 of the same subject. There are about 40 columns, and the image data is in Column K:K
There are thousands of rows, and I am totally stuck on how merge, transpose or otherwise get this data the way Access requires it...
View 2 Replies
View Related
Feb 7, 2014
I am in need of restructuring a spreadsheet of addresses for mailing purposes. (I tried to find something similar answered previously, but nothing seemed to work for me.)
I have attached a small example spreadsheet below, but our spreadsheets can be hundreds or thousands of rows in length.
I need a macro that will look for the "PO Box" addresses under the column headers named "ADDRESS2" and "ADDRESS3".
The PO Box addresses will need to be moved under the column header "ADDRESS1" within the same row.
It will need to overwrite the text that is already under "ADDRESS1" and delete the text from the "ADDRESS2" and "ADDRESS3" columns - UNLESS the text in 'ADDRESS2" is a PO Box AND "ADDRESS1" begins with "c/o".
If the data in "ADDRESS2" or "ADDRESS3" is anything other than a PO Box it will remain the same. As will "ADDRESS 1".
Basically if there is a PO Box it needs to be in the column named "ADDRESS1" and overwrite anything else that was there. The exception will be for PO Boxes that are in c/o someone else, the PO Box will then need to be listed in the column directly after the column that has c/o.
If the c/o exception will be too difficult the code could just highlight those scenarios and we could fix them manually. We usually do not have a lot of them, but enough that we need to be mindful of them.
The different scenarios are listed in my sample spreadsheet.Also, the code will have to use the column header names in row 1 because those headers are not always in the same column.
View 14 Replies
View Related
May 6, 2009
I want to add these numbered steps onto the macro I already have, which I pasted below.
1. Starting in Row 2 in the worksheet named Report 1 look at contents in Column A then look at the contents in Column C, if the contents in Column C do not match exactly the contents in Column A then copy the contents in the range column C:E from that row till the last row in Column C:E.
2. Now we will have a range that is made up of cells from C:E. I would like to move that range down a row at a time, until the first cell in Column C from the range Column C:E matches exactly the contents in Column A. Then I would like to continue this pattern for every row in the worksheet.
View 2 Replies
View Related
Sep 11, 2009
I have two spreadsheets, both contain matchable data. First one with amounts. Next one hs customer name, period and amount columns.
View 3 Replies
View Related
Oct 3, 2013
I need to match the first column with the second column, and if is the same value, copy the value in third column to the forth column.
View 1 Replies
View Related
Apr 15, 2014
I'd like to import column A,E, H, and I in different 11 workbooks in MYdocument folder to one Master workbook.
I'd like to import 'Name' and ' ID' in cell E3 and C3 in each different 11 workbooks to cell A1 and cell B1 in Master workbook.
Starting row for Column A,E,H and I are 'row 6' because row1 thru 5 are title, name, and comments.
In the Sheet 1 in Master workbook will be the Main sheet for command buttons, so I want to import after Sheet1 in Master workbook.
I want to import each worksheet , not stacked type. I got 11 workbooks in my document right now, but numbers are always changing. I also import in row 2 in Master workbook because I need to add title or button on row 1 in Master workbook.
How can I import only selected columns from row 6 into row 2 in master workbook?
View 11 Replies
View Related