Select And Copy Multiple Columns Based On 2 Data Fields

Feb 20, 2014

I have a spreadsheet with a heap of raw data in it. I need to perform a search based on a customer name, then return certain columns from the raw data IF the customer name is matched in one column, AND a special flag name is matched in a second column. The customer name is always a single entry for the purpose of the query, however the special flag must be checked against a possible list of values in a table. I know this is hard to explain, and I can't add attachments to my posts, so I have created a sample document and placed in in dropbox:

[URL] ........

View 9 Replies


ADVERTISEMENT

Populating Fields In Multiple Cells Based On Criteria In Multiple Columns?

Feb 24, 2014

Im struggling to find a formula to populate cells based on values to be checked in two fields (ICODE, COMPANY) as shown below.

In the example here, all records where ever the ICODE = 49, i need to populate the fields(columns) AD1,AD2,AD3 or AD4 with the product name of the same company where the ICODE <> 49. There could be between 1-7 products per company.

CURRENT SHEET

ICODE PRODUCT COMPANY AD1 AD2 AD3 AD4
89PENS ABC STATIONERY CO LLC [code]....

The attached example file may be a better alternative to view this problem.

View 2 Replies View Related

Copy Data From One Sheet To Another Based On Multiple Columns Of Criteria

Jul 27, 2013

I am working on a project to automate the import of data and fixing the formatting.

The data contains the date in column A and time in column B. The time is in increments of 15 min for each day. The rest of the data is in columns C:F. Some of the dates don't have all of the times within the day (so instead of 96 rows of data per day, there maybe 80 rows). I have a second sheet of just dates and times that has the correct amount of rows for each day. What I need to do is have the rows data that matches in both the date and time column from sheet 1 copied over to the corresponding date and time on sheet 2. Blank data rows on sheet 2 are fine. I have found some stuff on .Find, but the stuff I found was for specific searches.

Example

Sheet 1
7/27/13 12:00 AM 1 2 3 4
7/27/13 12:15 AM 5 6 7 8
7/27/13 01:00 AM 9 10 11 12

Sheet 2
7/27/13 12:00 AM 1 2 3 4
7/27/13 12:15 AM 5 6 7 8
7/27/13 12:30 AM
7/27/13 12:45 AM
7/27/13 01:00 AM 9 10 11 12

View 1 Replies View Related

Excel Macro - Deriving Fields Based On Multiple Rows Of Data

Dec 4, 2012

- The macro should then try to find this data on the worksheet "Sheet2" in the same workbook. This data on Sheet2 is essentially a table with four columns "Number" (Col A), "Country" (Col B), "Consol" (Col C) and "Bypass" (Col D) but can have around 70k rows

- It should look for Number first, and if its not found, the macro should insert the message "Update OK" in cell A8 on Sheet1

- If it finds at least 1 row for the Number but the Country is the same for all the rows and it matches the value input for Country on Sheet1, then it insert the message "Multiple Records - Update OK" in cell A8 on Sheet1

- If it finds at least 1 row for the Number but the Country is the same for all the rows and it does not match the value input for Country on Sheet1, and if all Bypass fields in Sheet2 have "Y" but the Bypass field input on Sheet1 has "N", then put "Multiple Records - Update OK" in cell A8 on Sheet1

- If it finds at least 1 row for the Number but the Country is the same for all the rows and it does not match the value input for Country on Sheet1, and if all Bypass fields in Sheet2 have "N" but the Bypass field input on Sheet1 has "Y", then put "Multiple Records - Bypass - Do Not Update" in cell A8 on Sheet1

- If it finds at least 1 row for the Number but the Country is the same for all the rows that have a Bypass value of "N" and it does match the value input for Country on Sheet1 then put "Multiple Records - No Need to Update" in cell A8 on Sheet1

- If it finds at least 1 row for the Number but the Country is different for all the rows that have a Bypass value of "N", then put "Multiple Records - Refer" in cell A8 on Sheet1

[URL] ....

TestBook.xlsm

View 6 Replies View Related

Macro To Select Multiple Files And Copy Them Based On Criteria?

Mar 10, 2013

This is what I am trying to achieve:

1) Prompt user to select a file (or multiple files)

2) Copy the files that meet certain criteria to a folder

My attempt (fail):
VB:

Sub FILES2SFTP() Dim FileNames As Variant Dim I As Integer Dim fso As Variant Dim Data As String ChDrive "G:" ChDir "G:TEST" Data = InputBox("Enter the date", "Enter the date", Format(Application.WorksheetFunction.WorkDay(Date, -1), "yyyymmdd")) Set fso = [code]....
I get error 424 object not found in this line:

If fso.getfilename(FileNames(I).Name) = ("Name1" & Data & ".xls" Or "Name2" & Data & ".xls") Then

View 3 Replies View Related

Userform One Combobox Three Data Columns Select Required Column Based On Radio Button

Jun 10, 2013

I have a user form that has one combo box on it that right now references one column of data.

Now I am being asked to have three columns of data and the combo box to show one of the three when a certain criteria is met.

I believe it would be easiest to have an additional combox with a change event when the box is populated with "whatever" in the field

So S:3 to S:5 have A, B, C

And EC:1-EC:59, ED:1-ED:59, EE:1-EE:59 contain the data that should show when S:3, S:4, or S:5 is selected.

If S:3 is selected then the list in EC:1 - EC59 would show and so on.

View 2 Replies View Related

Select And Copy Set Of Data In Column Based On Starting And Ending Values

Aug 26, 2013

I have a macro that copies three sections of data from a word document and pastes it within the Excel worksheet. The column of data is pasted in a single column (data to be space-delimited and evaluated later), and what I would like the MACRO to do is separate the three sections of data based on the starting and ending values of the section and place them in different columns.

Section 1 : starts with the word "Team"
Section 1 : ends with the word "City"

Section 2 : starts with the word "Location"
Section 2 : ends with the word " Date"

Section 3 : starts with the word "Member"
Section 3: ends with the word "Age"

So section 1 would be pasted into cell C1, section 2 pasted into G1 and section 3 pasted into J1.

Each section will have vary in number of rows between the starting/ending values, so to cut and paste the section based on the starting and ending value is vital.

View 7 Replies View Related

Copy Multiple Columns Based On Search Criteria To Another Worksheet

Sep 27, 2011

Rep Name is Column J Row 5. I need to find multiple columns based by the header which is row 5, if column range (j5:az5) is "Video - Actual" then copy column to sheet "Data", this needs to be repeated for about 8 more times for different criteria

Rep NameBundle - TargetBundle - ActualVideo - TargetVideo - ActualJoe, Jane
2.06.06.04.0Smith, John
7.010.02.06.0Tucker, Chris
19.039.05.017.0Sandler, Adam
15.011.06.010.0Iglesias, Gabriel
8.03.06.010.5Smith, Will
8.03.06.06.5Powers, Austin
10.025.07.09.0

View 1 Replies View Related

Macro - Copy Multiple Columns Down To End Of The Data?

Feb 18, 2014

I am trying create a macro that will create a new work sheet on an existing workbook. I have minimum experience writing a macro, but I do know how to effectively record one. The issue is, I need the macro to copy multiple columns down to the end of the data and pasting it into the new workbook at the end of the data already pasted-- rows of data are frequently added to the workbook.

View 4 Replies View Related

Copy And Paste Same Data To Multiple Columns

Jan 10, 2009

How can I copy a column (C6:C200) and paste it according to a cell value . If I have in a cell 5 it will paste column (C6:C200) five times .

View 7 Replies View Related

Copy Data From One Column To Multiple Columns

Sep 7, 2007

I found this treat but it didn't help me as i hoped. Move Data From One Column To Multiple Columns. I try to convert multiple datablocks to a new worksheet and make the adress blocks ready for further sorting and removing actions. The Excel I use is Dutch and i hope that i make my question clear. What I want:

copy each adressblock to another worksheet, put the initals as well as the beginning in a seperate column and delete the unnecessary comma's. Each adressblock is identified by a number in colom A. When a new number is shown, excel has to start a new line to fill. finally,if possible i like to extract the adress line into seperate colums of "street+numer", zip and place. Some adresblock have more than onder adres, if possible i want excel to ad these information in the 'extra' colums.

View 2 Replies View Related

Programming Multiple Inputs With Multiple Data Fields

Feb 19, 2009

I am trying to set up a "diet log" for my nephew to track his eating habits for a school project. I am trying to make the "total" section of the attached spread sheet auto calculating depending on the information placed in the "breakfast / lunch / dinner / snack" catagories. I have two worksheets in the file. The first being the preferred method of a single cell and seperating the items using only a ",". The second sheet has a little bit different lay out which I don't think will work as nicely.

Honestly, I am not sure if this will even be possible, but I figured I would try here as a final resort. Currently there are just some sample foods in there as I will let him fill in the actual workbook for his use.

View 7 Replies View Related

Create Auto Populated List Field Based Off Multiple Fields

Apr 21, 2014

I have two or more fields of data, where parts of them are auto populated based on inputs from elsewhere. That part i have working fine, however the problem arises in taking that information and displaying it as a Bill of Materials list on another tab in my excel file. I want to take the information, and only display it in the BOM tab if that piece of information is being used (ie item count field not being 0). I know how to do that part in a rather simple format, however i'd prefer to make it so that when i have the list, and a certain item isn't used then its not included in the BOM, and an empty space is not left behind. I would prefer this to be all be done automatically by a formula if possible instead of just having to resort to sorting the table every time the tool is being used.

Is this even possible in excel, A quick example doc is attached, shows 2 example fields. i'd like to take the information from those 2 fields. and somehow create a single list, with a single heading along the top, with all row containing a 0 "Unit Count" to be omitted entirely from the list, and not have a blank space where the item should be. Keep in mind these fields may be greater than 2, and may not be position one after the other in a strait down line.

Example.xlsx

View 4 Replies View Related

Check Data For Changes In Multiple Columns And If Changed Copy To Another Sheet

Mar 8, 2014

This is my basic setup, each piece of equipment will have more than one routine to be performed:

Equipment Type
Make
Model
Serial
Location

To Be Performed
Frequency
Last Performed
Performed By
Next Due Date
R1

[Code] ..........

I want to track changes on "Last Performed" and "Performed By" and, if changed, copy both values to a separate "log" sheet. In total, there could be up to 10 routines for each peice of equipment. That means I would need to track 20 columns for changes. I would like this check to be done on save because that ensures that the user is satisfied with their changes and keeps the log from being flooded. And lastly, it needs stored in the log sheet in a way that I can identify which piece of equipment it was for and which routine was done.

View 1 Replies View Related

Copy Data From Multiple Sheets (different Columns) Into A Main Sheet

Jul 7, 2009

I have multiple sheets Names(Sheet1-Sheet5).

Im trying to compile them all on the same sheet (Main Sheet). But each sheet is NOT the same. I need to choose what Columns needs to be copied (I can use one macro for each tab if needed)

For example I need Sheet1, Columns (A,C,E,G,S) copy that and then go to (Main Sheet) and paste in the next blank line (column A)

Seems like it does not know where to paste.

Here is one I have tried ....

View 9 Replies View Related

Multiple Data Validation Across Multiple Fields?

Jul 23, 2012

I have a spreadsheet setup like a timesheet: Employee Name, Classification, Rate, etc.

I setup the Employee Name field as a drop-down. Since there are numerous employees with different rates, I want to just select a name so that the other fields fill-in with the appropriate rates.

View 1 Replies View Related

Select Multiple Sheets And If Value In Cell Is True Then Copy Values In All Sheets And Hardcode Data

Feb 26, 2012

I have a workbook that updates from external source and creates sheets depending on a cell range.

I have put tab 1 and tab 0 on either end of where the new sheets will be inputted, will never know how many sheets

What i need to happen is if someone fills in "complete" in A7 in my "summary" sheet then the values in row 6 in all the other sheets get hardcoded. This needs to happen from A7 down to A26, so A8 = complete then copy row 7 etc
This is what i have so far

I get compile error here ........Sheets(ArrSh(1)).Activate

Also need it to work for all the other rows.

Sub hardcode()
'
'Sheets("Summary"). Select
If Range("a7") = "complete" Then
'
Sheets(Array("1", "0")).Select
Sheets(ArrSh(1)).Activate

[Code] ......

View 2 Replies View Related

Copy Excel Data To MS Project Fields

Apr 28, 2014

Writing a macro in excel where you can use the data in your excel file to copy data to microsoft project.

I have an excel file of task name, deadline, time remaining, and assigned to and I want to copy those 4 columns to a correlating column in project. So basically I would loop through these fields on each line til I reach a blank which could be entering a varied amount of tasks.

The full macro would change ms project start date to today's date then copy the 4 columns from excel to project to add a new task for each line in my file and then save the project file.

I've seen some links on macro with project but most are more advanced then this or are exporting data from project to excel.

View 1 Replies View Related

Formula To Handle 5 Fields Of Data To Avoid Creating Extra Columns?

Nov 27, 2009

I am inputting 5 variables in columns A through E:

Family (Y/N)
Adult (1/0)
Child (1/0)
Date of Birth
Gender

I am attempting to generate:

Age Males in families sorted into age brackets
Age Females in families sorted into age brackets
Age Males single sorted into age brackets
Age Females single sorted into age brackets

I did this rather simplistically generating 4 columns (F through I) and then using COUNTIF (although I know there is a better way than the lame way I used COUNTIF but that is not the point right now).

However, my question is, can I generate the data described above (located in D13:I22 on my spreadsheet) without going through the messy, cumbersome step of creating extra columns?

View 6 Replies View Related

Convert Column Data Fields To Row Data Fields In Pivot Table

Feb 8, 2014

CountryHourDataTotalData
Austria - A10Sum of SeiA51CountryHourSum of SeiASum of SeiT
Sum of SeiT4.88Austria - A10514.88
1Sum of SeiA561562.83

[Code]....

left side pivot created in vb 6.0 & right side pivot table created manually in excel.

i want to generated pivot table using vb 6.0 same as right side pivot.

Set PRange = ws1.Range("R1:Y" & finalrow)
Set PTCache = wb.PivotCaches.Add(SourceType:=xlDatabase, SourceData:=PRange)
Set PT = PTCache.CreatePivotTable(TableDestination:=ws2.Cells(1, 1),

[Code]....

View 2 Replies View Related

Compare Multiple Fields For Data Range

Jan 25, 2014

I'm doing a study of wind turbines, which are spread over a test field. There are 6 turbines, each checked once a day and produces a value. I look up what the weather man says it should be, "Reported" field.

Compare141622263647

DayWind1Wind2Wind3Wind4Wind5Wind6Reported
2872 6918243519
2867122327303133
2854111324324619
28422232527284624
28319233136454627
282411182841448
2819121622264814
28016242530344549

The "Compare" field values must match all values for each turbine. The speeds identify the location with the best match speed against output of power generated. As each value in "Compared" is the best speed for that type of turbine.

View 4 Replies View Related

Copy Data Across Multiple Worksheets (based On Three Criteria)

Feb 16, 2010

I have data on a worksheet (“Interface”) that I need to copy over 7 other tabs for analysis.

("Module_1", "Module_2", "Module_3", "Module_4", "Module_5", "Module_6", "Module_7").

The linking Field on the Interface tab defines what row I need to paste the data to on Module 1-7. The column headers are the same on both the interface and other tabs (“YES, NO, N/A, BLANKS, STANDARDS MET, STANDARDS NOT MET, NOT APPLICABLE”)

The tab is selected based on the row
Module 1Medication Management
Module 2Privacy
Module 3Process
Module 4Patient Safety
Module 5Medical Records
Module 6Infection Control
Module 7Environment of Care

I’m trying to modify code written for a similar purpose with no luck. This is the code I'm trying to modify. I know I'm not on the right track yet.

View 2 Replies View Related

Multiple Dropdown Select (multiple Columns)

Mar 4, 2009

I have VBA code below. Currently the code allows me in column "N" to choose more than one item in a dropdown menu. I am trying to find a way to make column K and M do the same thing. I have tried a number of ways but to no avail.

View 2 Replies View Related

Extracting Data From One Worksheet To Another With Multiple Fields To Populate

May 1, 2013

I have a table of data from which I would like to extract the information which is listed horizontally.

Column A Column B Column C Column D
Code Name Address Locality
SMITJOHN John Smith 123 Bell Rd Perth

On the 2nd worksheet I have a form which I have designed to which I would like to extract the information from the 1st worksheet.

I am hoping that it is possible to start entering a code based on some reference on the Name. Eg SMITJOHN

Once the code is true or correct it will populate certain cells on the 2nd worksheet automatically.

I work in transport and am looking to streamline some of the paperwork and am trying to do it within the means I have available to me.

The format of the 2nd worksheet is;

CODE: SMITJOHN
NAME: John Smith
ADDRESS: 123 Bell Rd
LOCALITY: PERTH

View 3 Replies View Related

Select Multiple Columns In VBA

Nov 1, 2012

To select multiple columns I can use Union but can I use something that will cicle through the values from an array?

Example (how do I see this)

VB :

columnsToDelete= array("UM","Post","Pre")
For i=0 To UBound(columnsToDelete)

Set columnsFound=Range("1:1").find(what:=columnsToDelete(i), lookin:=xlvalues,lookat:=xlwhole, matchcase:=True)
columnsFound.select
Selection delete
Next i

View 2 Replies View Related

Select Multiple Columns

Sep 15, 2008

I am using VBA to change the format of columns. The code work with 1 column, but In need to change the format of mulitiple columns. E.g Cols 11 to 22. I tried the code below but it does not work!

View 3 Replies View Related

ADO Select Distinct Multiple Columns

Aug 5, 2009

I am using ADO to select data from a CSV file, column 1 has some duplicate Incident numbers, but the rest of the columns the data may be different but not interested in that so I cannot use SELECT DISTINCT incident, desciption as this applies to all columns

so I tried the following

StrSQL = "SELECT DT.IncidentNumber, ST.Description -
FROM (SELECT DISTINCT IncidentNumber FROM " & StrFile & " ) DT -
INNER JOIN " & StrFile & " ST ON DT.IncidentNumber = ST.IncidentNumber"

however it returns ALL rows, if I use just

SELECT DISTINCT IncidentNumber FROM " & StrFile

I get the rows I am interested in but not the extra data I require

View 9 Replies View Related

Select Multiple Cells Based On Multiple Criteria?

Sep 25, 2013

I would like a macro that select all cells based on multiple criteria. It's a big sheet, but I've made it smaller in the following example.

In row 1, there are 2 headers, in B1 (electricity) and C1 (gas) In column A, there are 3 houses, in A2, A6 and A10. The blocks of cells in between (e.g. B2:B5) have 2 headers, 'period' in B2, and 'account number' in B4. B3 and B5 have a list of options in them.

I want to select cells that meet certain criteria. Either electricity or gas, and either period or account number. So, if in cell D1 I choose electricity and in D2 period, I would like to select B3, B7 and B11. If I choose gas and account number, I wish to select C5, C9 and C13.

View 1 Replies View Related

Macro To Transfer Data From One Sheet To Another Based On Date And Reset Fields

Jul 16, 2014

I am currently working on a workbook to have employees fill in data on what tasks they compelted for the day, and how long it took. There are 5 colums (for this purpose) Task, Description, Time, Required to complete, Completed. The tasks are predefined and listed out in each row. There is also a space for employees to select the date they are entering the data for.

I would like to have a macro that is linked to a submit button and when pressed populates this data into a database on another sheet. This database is split into two sheets (1 with time and one with tasks required/compelted). Each sheet has the list of tasks going down a cloum on the left, and dates along a row on the top. When the employee presses submit I would like this data to popuplate in the coresponding date and task fields and then reset the form on sheet 1 to all 0's.

View 1 Replies View Related

Select Cells Across Multiple Columns On Variable Row?

Nov 25, 2011

I'm trying to write some code to select cells in a number of columns on a variable row. I have the following code to define the rownumbers for Cash and Pal:

Columns("G:G").Select
Selection.Find(What:="Total Cash", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _

[Code]....

Then I can use the following code to select a cell in a single column:

Range("P" & Cash & ":P" & Pal).Select

but I need to select cells in columns P, R, T, V, X, etc.....

If I was doing this for a fixed rownumber I would use:

Range("P22:P23,R22:R23,T22:T23,V22:V23,X22:X23").Select

but because my rownumber is variable I tried to use:

Range("P" & Cash & ":P" & Pal, "R" & Cash & ":R" & Pal, "T" & Cash & ":T" & Pal, "V" & Cash & ":V" & Pal, "X" & Cash & ":X" & Pal).Select

but this doesn't work giving the Compile error: Wrong number of arguments or invalid property assignments

View 4 Replies View Related







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