Copying Data From One Cell To Another Based On Criteria
Jun 22, 2014
I am trying to use VBA to move data from one column to another while using values of a third column as a reference for where each value in the first column should be moved to in the second. I will try to explain as best as possible, currently I have a macro that copies from one column to the required but due to the irregular spacing of the data it results in the data not matching with the data its being copied into.
Say I have Three columns A, B and C. I have a range of data in column A say dates that have irregular amounts of spacing between them. Column B is empty. Column C contains Data that is again spaced out irregularly and not in line with that of A. The value of column C cells is just identical values. Now the aim is to move the values from column A in the order which they are listed and place them in Column B next to each value in Column C. So say the repeated value in column c is EXAMPLE then everytime EXAMPLE appears in column C i want to move one date from column A into column B next to this EXAMPLE value, in order which it appears in column A. So the first date will move next to the first EXAMPLE value and the second date which appears next to the second EXAMPLE and so on and so on until it reaches the end of the sheet.
My thinking was placing the A column data in an array and doing some sort of sort.
View 3 Replies
ADVERTISEMENT
Feb 16, 2007
I am have a spread sheet (sheet 1) with a number of columns and what i am looking to do is see all the people that are participating in a certain stage in the process that is not common, So what i am wanting to do is copy the names and the corresponding number of these people (on sheet1) over to a new worksheet(sheet2) based on a yes or no criteria further on in the spread sheet(sheet1). sheet 2 has additional columns that the workers here would need to fill in.
The criteria is in sheet 1 cells Y2:Y2000
The number is in sheet 1 cells D2:d2000
The names are in sheet 1 cells E2:e2000
If its at all possible i would also like to then make the names of those people on sheet 1 a hyperlink to the additional information
View 4 Replies
View Related
Aug 14, 2009
On sheet "Create Package" in cell "AA14" I have a value (lets say 2).
I want it to go to sheet "Samples" and insert a number of rows equal to the value on sheet "Create Package" cell "AA14" (so 2 rows)
I have a header row in row 1, so I would like it to insert the designated number of rows beneath that.
Then I would like it to copy a designated number of rows (based off of the "AA14" value, so 2) from the "Create Package" sheet starting at row 66 and then paste special values into the new rows that were inserted on sheet "samples".
View 9 Replies
View Related
Aug 22, 2009
I am trying to copy two cells from one worksheet to another in the same work book based on the value in Column B of one of the sheets. This is just a building block to a larger script I am going to create.
Below is my attempt but I keep getting an error at Range(Cells(x, 3)).Select.
View 7 Replies
View Related
Nov 11, 2009
There is a Summary sheet from where data has to be copied to 3 different sheets(for 3 accounts) I have highlighted the columns that have to be copied. The macro will be run everyday, and each day only 3 rows from Sheet ‘Summary’ will be copied to the other sheets.
Important point: Only copy rows that have Column D value = GBP
Which Sheet to copy to? Check Column A ---
Case 100 = Sheet(“ONE”)
Case 200 = Sheets(“TWO)
Case 300 = Sheet (Three)
The Orange ones – Column C,I, and N are copied as follows: C goes to Column A, I goes to Column C, and N goes to Column J in one of the 3 output sheets.
It should not overwrite previously existing data, simply copy to next empty Row (By Empty Row I mean Column A is empty, columns after M may have values in many rows)
Then the Yellow columns. I need them copied on W26:W32. So that’s cells in Column E,J,K,L,M,R going to W26:W32. These yellow column figures must OVERWRITE previous data (unlike the Orange). The Blue cells that you see in Sheets (ONE,TWO and THREE) contain formulae that I want copied down to the Next Row when there is an entry made in Column A.....
View 5 Replies
View Related
Sep 17, 2012
I have 2 excel files, let's call them 1.xlsx and 2.xlsx (excel 2007)
File 1 is the file where I want data copied into and file 2 is the file I want to copy data from.
File 1 has certain text strings in every say 5th column in always row 2. I want to find those strings in file 2 and if the string is found, go 6 rows down, copy the cell, and paste it into file 1, 8 rows down the text string. this is the code I came up with, but it doesn't work
Code:
Option Explicit
Sub get_data_from_2()
Dim i As Long
Dim j As Long
Dim FinalColumn As Long
Dim RngFrom As Range
[Code] .......
the bolded part gives me an error.
View 3 Replies
View Related
Jun 23, 2014
Example.xlsx
I am wanting to have a sheet that I use for reporting based on another sheet in the workbook but I want to exclude items that are closed.
The first sheet will contain all rows of data with a status column of either Open, On Hold or Closed
In the second sheet I only want to have listed the items which are Open or On Hold, I want to ignore the closed items.
In the example enclosed, I only want rows 2,4,6 and 7, but NOT 3 and 5 due to status.
View 2 Replies
View Related
Apr 7, 2014
I have a workbook that has three worksheets. The ASU Database sheet contains part numbers and descriptions including specific details that are selected from pull down data validation lists that are named on the third worksheet. I want to have a front end on the first worksheet that has similar data validation lists for the user to select from to create a search criteria that will create a worksheet with only the rows that meet this criteria. I am not sure what method to use to accomplish this.
View 2 Replies
View Related
Jan 8, 2009
I'm looking to create a macro that will take data from an input sheet, and paste it into a cell in another worksheet, based on criteria specified in sheet1.
Specifically in the attached example, the macro would copy the data in cells C8:C10 of sheet 1, then paste them into sheet 2 based on the data specified in cell B3 i.e. it would paste them into the column headed Mar-09. I intend to make this cell a drop down, so that the user can then select the next reporting month and run the macro again to paste the data into the Apr-09 column.
View 2 Replies
View Related
Sep 5, 2013
copying data from one sheet to another if it meets a certain criteria. I have a long aged debtors report that has several different cost centres and I want to split it out on to separate tabs for each centre. I want a function or marco that will go to row 1 and check if it equals the cost centre name on the other tab in a cell and then copy it and paste it in that tab, if not then it moves down to the next and the next until it gets one that does equal it and then copies it again.
View 1 Replies
View Related
Feb 19, 2014
I am finally at the end of this project. I need to find a code that will copy any lines that the person has turned 65 in the previous month or that will turn 65 in the current month to the Monthly tab.
Sample Macro jscalem.xlsx
View 3 Replies
View Related
Aug 23, 2008
I have data as follows.
In the first column name of the month is specified.And in the third column of the same row day is specified.And followed by some data in rest of the columns and rows.
I need to copy the data from the presant sheet to a new sheet based on some conditions.
first need to search for the row where the word "MONTH" is there.if it is found then in the same row third column need to be checked for the day like "MONDAY" or "TUESDAY".If it is monday then need to copy 6*8 array of data i.e. (6 rows and 8 columns) into a sheet "MONDAY".if it is TUESDAY then 5*8 array data into a new sheet TUESDAY.And the search should be continued till the end of sheet.
View 9 Replies
View Related
Apr 2, 2008
I have a worksheet named newvehicles with data in columns N to T. I have the branch names in column S.
I need VBA code that will copy all the branch names that are the same as well as their corresponding data i.e the data in columns N to T into a new worksheet with the same name as the branch being copied for eg if column S contains BR1, BR2, BR3, BR4, BR5 etc, then I need all the data for BR1, BR2 etc to be copied into a worksheet Br1, Br2 etc
The values are in columns P:R ("newvehicles"). I need these values to be added using VBA code as soon as this data has been copied accross. When pasted into the new worksheets, it can then be from the first column onwards
View 9 Replies
View Related
Apr 30, 2014
I have a workbook consisting of 5 sheets.
Sheet 1 is the master sheet, and (among many other columns) it has a series of yes/no columns. The yes/no options are the equivalent of:
"Are you in sheet 2?"
"Are you in sheet 3?"
etc.
When this is the Yes option, I would like the rest of the contents of the row to copy into sheet 2.
These need to remain linked, so if I change stuff in Sheet 1 I would like it to change everywhere.
View 4 Replies
View Related
May 11, 2012
I have a spreadsheet with data in a1:p100 and i'm trying to find a macro that anytime the cell contents change in either column B or Column F it copies the entire row to another tab in the spreadsheet.
View 9 Replies
View Related
Aug 13, 2009
I have a name in cell A1 and a number of 20 in cell B1. Is there a function to copy the name in cell A1 the number in cell B1 (20 in this case) times into column C?
View 9 Replies
View Related
Jul 27, 2012
I have :
A1 = "Banana"
A2:10 = blank cell
B1 = xxxxxxx (always 7 digits) (number)
B2:B10 = xxxxxxx
How to fill the range of A2:A10 with "Banana" only if the value in Column B is having a value (or not blank)?
The second one is, how to delete entire row if the value in column B is text?
View 9 Replies
View Related
Oct 8, 2013
With reference to attached file. I want to copy column D&E for 'n' number of times of value based on B1. If value in cell B2 is 0 then hide cell D&E and if there is any other value, excel to copy E&F to next column (leaving one column blank after each paste).
A
B
C
D
E
2
Product A
Price
VTA-2001
999
VTAA-2001
1299
XMV-1001
1000
View 5 Replies
View Related
Jun 17, 2008
I have a workbook called "Staff Planner". I need to check Columns C to I in Sheet "Plan" to firstly find text in a red font, and then copy this value to Sheet "Useage" in Column K. (So, search C1:I1, find red font, copy contents of cell, paste value to K1). I then need to repeat this with blue font/value to H1, green font/value to E1, and finally pink font/value to B1
View 9 Replies
View Related
Sep 26, 2011
I am wondering if it possible to automate the copying of data from particular cells, based on a value in a different cell, into a different format.
So to go from this simplified table:
AB1NameLevel2Arthur2a3Briony3c4Catherine3b5David3a6Edward2a7Felicity3c8George3c
to something like this:
FGHI12a3c3b3a2ArthurBrionyCatherineDavid3EdwardFelicity
4
George
At the moment I do it all manually, and it takes forever. I am sure there must be a simple way of doing it. I am using Excel 2003, but could work in a newer version if required.
View 9 Replies
View Related
Feb 8, 2014
I have a spreadsheet that is updated weekly -- but every week new info is added that needs a user to input corresponding info. I use a vlookup function to link to another spreadsheet that populates the info from previous weeks and the info that is missing shows up as #N/A...
First I was using a msgbox function to get the info:
HTML Code:Â
For Each b In myrange
If Application.IsNA(b.Value) Then
Employee = b.Offset(0, -2).Value
SSID = InputBox("Please enter ID# for " & Employee & " :", "New Employee Found")
b.Value = SSID
End If
Next b
But it can be up to 30 different new employees... and that is time consuming.
I would like to make it more user friendly by creating ONE userform that displays all of the employees as labels -- has a text box in which to put the ID # -- and then has a drop down box to choose the type of employee (2 options). I want all of that info to go back to the reference spreadsheet so it will be saved for following weeks, and then redo the vlookup to get the info into the new weekly spreadsheet (I can do that part)....
HTML Code:Â
Private Sub CloseButton_Click()
Unload UserForm1
End Sub
Private Sub ComboBox1_Change()
[Code] ......
View 2 Replies
View Related
Aug 31, 2006
Hi, have a question regarding dynamic charts, specifically I am trying to create several dymanic charts based on data in a single column (So i can only say my first set of data will be starting a a set location in the chart, the rest has to shift down based chart data above it). This data should organized in charts depending on the data in several other columns. For instance, need to pull out values from column based some ID and some PartNumber. A sample excel or VBA would be much appreciated. I know VBA but do not know Excel VBA much.
View 9 Replies
View Related
Jun 12, 2008
I have two columns of data in my worksheet.
Column-A Column-B
AAA 123-XXX-123
BBB 123-XXX-123
CCC 123-XXX-123
and so on
I would like to setup a marco to copy what is column A and replace XXX in column B. So the result as follow
Column-A Column-B
AAA 123-AAA-123
BBB 123-BBB-123
CCC 123-CCC-123
and so on
View 9 Replies
View Related
Dec 23, 2006
123569LOC23 is in one cell and I am trying to copy the "LOC23" to a new cell. However, the amount of digits vary: LOC23, LOC1,LOC15 etc all the way down the column.
View 9 Replies
View Related
Jan 8, 2009
12/23/20081/2/20091/5/20091/6/20091/7/2009Stores TotalTMX TotalTotal TMX Expedite
I'm trying to create some code that will do this:
On Day1- Copy info from a different worksheet in the 3 cells for 12/23 (column B)
On Day2 - Copy info from the worksheet in the 3 cells for 1/2 (col C) without deleting the info in Column B from the previous day, etc....
I can't figure out how to get it to paste into a different column each day. It will be continuously moving one column to the right each day.
View 9 Replies
View Related
Jun 28, 2010
I have a data sheet with 20 columns and about 300+ rows. In the results sheet there are 3 criterias (from column A, B, H in datasheet) which are in the form of dropdown in cell A1, A2, A3.
I would like to extract the data from the data sheet based on the criterias selected from dropdown list, to results sheet starting from row 6, with only 12 headers out of 20 (non-continuous, e.g. columns A-C, E, G-K etc.)
View 3 Replies
View Related
Dec 19, 2012
generating a formula that takes into account a range of values (an entire row) and from this row, I would like the formula to select, for example anything greater than 80%. After the formula selects anything greater than 8, I would like for it to select cells that are above or below the cells that have values greater than 8.
1
2 JLKNSTTP
3 85934942
4
5
For example, in the above datas, I would like a formula to select anything greater than 8 in row three and select cells above it. In this example it would be j, k, and t.
=if((3:3>8),offset(A3,-1,1,1))
View 1 Replies
View Related
Jul 16, 2014
I need to populate data based on criteria.
The criteria has been attached as follows.
Sample Test.xlsx
View 2 Replies
View Related
Feb 16, 2009
I need a data validation to prevent entries when they are > 50, but only if the value of another cell in col A is "Payment". The value of 50 is an example, I have another formula to get this number using VLookup.
The idea is that if the value of the cell in col A is "Income", I don't want the entry to be rejected. But if the value in col A is "Payment" or "Transfer" and > 50, I want the entry to be rejected (if I only have $50, then the payment cannot be > 50).
View 7 Replies
View Related
Feb 18, 2012
I have a problem and I hope that it can be solved using a macro. Basically, I have a set of data in column A and B in sheet(1):
A
B
1NameDate
2JOY12/09/11
3MAR12/12/11
4DAVID12/12/11
5
I have another set of data in Sheet(2):
A
B
C
D
E
1NameDatesalary
CHARACTERRATINGS
[code].....
basically, I would take into consideration the names and dates in sheet(1) and if it matches sheet(2) then it would then paste their salaries, characters and ratings into sheet(1).
View 9 Replies
View Related