Copy Cell To New Location Based On Criteria In Another Cell?

Jun 25, 2014

I've sent out a survey asking people to sign up for one of two groups, A or B. I have a table with a long string of responses, with the name in column A, and in columns B or C there is an X that shows whether they have chosen Group A (column B) or Group B (column C)

I am trying to write a bit of code where it would paste the names into a new table with the headers Group A and Group B. Here is what I have pieced together so far:

Sub Create_Groups()
For i = 2 To Range("B2").End(xlDown).Column()
If Range("B" & i).Value = x Then

[Code].....

View 5 Replies


ADVERTISEMENT

Copy Cell Value To Cell On Other Sheet Based On Two Criteria

May 8, 2014

I used this vba code before:

[Code] ......

And it worked perfectly, but now i wanted to use it in an other file but just change the sheets and I keep getting an Error 13.

It should copy the data from sheet insertmeasurements c23 till end of data in the column next to it (is dynamic) and based on cell B1 and the matching category code in column B, put that data in the matching cell in column C to the matching cell (based on the criteria in column B and C) on the sheet storedata.

Attached File : Profitibility Database v1.4.xlsm‎

View 1 Replies View Related

Excel 2010 :: Find A Cell Within Range Then Copy That Cell To Another Location

Sep 26, 2013

(I am using Excel version 14.0.7106 and MS Office Professional 2010.)

I have a macro in which I have named a range of numbers in a spreadsheet, used the "find" function to find a particular number in that range, and now would like to copy some information into a cell in the same row as the found number. However, when I try to move over to the cell that I'm copying to, it only goes to the 1st row in the range that I have defined.

Here's the portion of code I think you need to see. Everything works...it finds a match...but then I don't know what to do from there to get the information to the correct row:

'Grab the 1st project number
Range("C8").Select
Do Until ActiveCell.Value = ""
If ActiveCell.Value "" Then
prjnum = ActiveCell.Value
Selection.Offset(0, 8).Select

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

View 7 Replies View Related

Finding A Cell In A Variable Location Based On The Contents Of The Cell

May 2, 2012

I am creating a macro to automate data analysis for work, but I've become stuck.

I need to find the coordinate of the first cell in a column with word "reserved" or "extended" contained in the cell, and then assign the row number of that coordinate as a variable to use for moving data around. Basically, I want something like VLOOKUP, but instead of returning a value, I want it to return the coordinate.

View 1 Replies View Related

Copy Cells Based On Criteria In Other Cell

Mar 20, 2009

I want to copy cells A&B where there is a value in G to a new workbook. I need to loop through the workbook as there are 25 sheets in the workbook, and there 8 workbooks to go through.

There are 31 rows on each sheet, and there are only a few values in column G on each sheet.

A is customer name, B is Account No, G is Insurance premium paid, columns C to F, and H to M have other accounting data in them.

The idea is to create a global list of all customers who have already paid their insurance premiums.

View 9 Replies View Related

Copy Range Of Cell Onto Same Location On Different Sheets

Feb 25, 2009

copy range of data from "sheet1" to sheets named A-Z i.e A,B,C,D,E..... in the same location as it was on sheet1 e.g. if on sheet1 data was in B1:C10. i want to copy this onto the sheets named from A to Z in the lacation.

View 9 Replies View Related

Copy Cell Values While Id Value Is Same To New Location Then Repeat For New Id Value

Jul 14, 2006

what I need to do is , while an id value is constant copy 2 adjacent cells to a new location on the same row as the first occourance of the id value, then if the id is the same on the next row repeat the copy and add these 2 values to the cells next to the ones previously copied.

Once the Id value changes then the copy restarts on a new row which is the same as the first occourance as the new id value and repeats the same sequence as described in the first statement.

I have attached a sample spreadsheet showing an example of the source and how I would like it to end up, the colour is only there to seperate the outcome from the source and is not required in the code.

View 9 Replies View Related

Cell Value Based On Mouse Location

Jun 25, 2007

Is there a way to have excel track where my mouse is hovering(say if I have it hovering over cell A4) and have it return the value of A4 in a different cell (e.g B7)?

This would occur in real time - that is, as my mouse moved over the spreadsheet, B7 would update in real time.

Note I would also accept someone selecting the cell - hovering (no select) would be ideal but selecting is OK.

View 6 Replies View Related

Creating Variables Based On Cell Location

Oct 10, 2009

if Row i Column j is activated then a corresponding variable Aij, Bij, Cij or Dij would be created (if not already existing), or cumulated by 1. The problem as I see it - completely generalised - is to create a variable where the variable name itself is formulaic, as well as its value. I know SAS would have no problem with this due to the order in which it parses data steps, but I'm pretty amateur with other programming languages so I don't know if this is blindingly obvious or downright impossible!

View 3 Replies View Related

Select A Range Based On Active Cell Location?

Oct 27, 2009

I'm trying to select a range of cells whereby the range is dependent on the currently active cell. I know you can use the "Activesheet.Range("A1:D2").select" method to select a range where the cells are always the same, but I'm after a dynamic selection where the values can be programmatically altered depending on some other result.

For example, let's say that I make a certain cell active (based on the result of some other formula), and I want to select the range of cells in the adjacent column that is X rows deep. Putting this into context, imagine the resultant active cell is B2, I then want to select the range C2:C10, but if the active cell is E10, the range selected would be F10:F18 (if active cell is X, then range would be Y:Z).

The Offset function would allow me to position the cell based on the current active one, but it doesn't let me select a range. The Range function only lets you choose either hard coded or index cells, e.g. "Range(cells(y,z), cells(y,z)).select", but this is still no good because I'd need to know the index value of the active cell (can this be done?).

View 4 Replies View Related

Copy Individual Data Values In One Column To Single Cell Location On Multiple Sheets?

Jan 24, 2014

I am trying to come up with the most efficient way to copy data to multiple sheets within the same Excel workbook. The original data exists within one column on a summary sheet (could have up to 500 individual entries). I want to copy each individual entry to a unique sheet (that already exists), but in the exact same cell location within each sheet. I would only want to copy the original data value and not any formatting. Is there an efficient way to do this?

In my example spreadsheet, the original data is on the SUMMARY sheet. Sheets A through J would be the target sheets, with cell B2 as the target location for each of those sheets. My example shows the result of a manual copy paste value process, but I am hoping to automate that.

View 14 Replies View Related

Excel 2013 :: Macro - Paste To Column Cell Location Based On Variable?

Jun 16, 2014

I have data in E6-E67 on Sheet 1. Based on the date in A2 on that sheet, I need to paste to a column in Sheet 2. In excel, I am able to get the cell location through vlookup and get the correct column number/cell reference. When it gets to the paste location, I am stumped on how to format that line of code? Do I need sometime of variable? I tried to use the address/lookup code but it does not work.

I have excel 2013.

View 4 Replies View Related

Reference Cell Based On Button Location & Determine Button Used

Mar 7, 2008

I received this code from an example I found once upon a time that was originally submitted by someone else. Right now the code enters the current date in a cell of the same row as the checkbox when it's checked. I need to revise it, or come up with something similar, that will reference the value of a cell when it is in the same row as the button (from the Forms toolbar) that is clicked to activate the macro. First of all, I don't know how to reference a Forms button in VBA.

Sub Process_CheckBox()
Dim cBox As CheckBox
Dim LRow As Integer
Dim LRange As String
LName = Application.Caller
Set cBox = ActiveSheet.CheckBoxes(LName)
' Find row that checkbox resides in
LRow = cBox.TopLeftCell.Row
LRange = "B" & CStr(LRow)
'Change date in column B, if checkbox is checked
If cBox.Value > 0 Then
ActiveSheet.Range(LRange).Value = Date
'Clear date in column B, if checkbox is unchecked
Else
ActiveSheet.Range(LRange).Value = Null
End If
End Sub

Here is some other code I already created. Unfortunately, because I don't know how to do the row reference, I had to create 25 different macros, which just bulks up the size of my file and slows it down. But here is what I'm trying to accomplish in my macro:.............

View 8 Replies View Related

Excel 2010 :: Copy Data From One Cell Based On Color Of Another Cell To Different Worksheet

Jan 30, 2014

I have an Excel 2010 spreadsheet consisting of many worksheets (20 or so). Each of these worksheets contain detail level data regarding different projects. One of the columns in these worksheets is the 'Status' column (column F). There is conditional formatting on this column where if the text is 'G' then change background to a green color, 'Y'=yellow, 'R'=Red and 'U'=Grey.

The first worksheet is a summary sheet that I would like to pull information from each of the detail worksheet's columns B, D, E, G and H if the status column (Column F) is 'R' or 'Y'.

The number of rows in the detail worksheet can change each week (as few as 0 and as many as 100)

View 2 Replies View Related

Search Coloured Cell In Worksheet And List The Cell Location

Jan 10, 2013

I have a worksheet size roughly 100 * 400 cell. there is roughly 100 cells filled with RED color and with different value.

When i used FIND ALL format - RED, I can locate the cell location and the cell value. And I wish to copy these 2 info onto a new sheet so that on the new sheet, I can create a hyperlink and easily access to the location of the RED cell.

However, in FIND and REPLACE, i have a list of results on what I want. But i cannot copied the information out. So is there anyway to copy it out or to achieve what i want?

For eg.
RED value
cell
50
A3
87
D71
251
AQ5

and so on.

View 4 Replies View Related

Search Column For Cell Starting With X Then Copy Row To A New Tab Based On A Cell Value

Jan 13, 2014

I have an tab with 20,666 rows that I need to separate into different tabs based on what a cell in a specific row starts with.

Data Tab
001-020-002-000 Walker River Irrigation DistPO Box 820 YeringtonNV89447
001-020-005-000 Walker River Irrigation DistPO Box 820 YeringtonNV89447
001-020-006-000 Walker River Irrigation DistPO Box 820 YeringtonNV89447
001-020-007-000 Walker River Irrigation DistPO Box 820 YeringtonNV89447
001-020-008-000 Walker River Irrigation DistPO Box 820 YeringtonNV89447

[|Code]...

So what I am looking to do is search the APN row in the Data Tab that starts with the number from the APN # row in the APN Tab and then copy the row to a new/existing tab named after the Description on the APN Tab.

I think that I have explained what I need to do

View 8 Replies View Related

Copy Cell Values In One Cell Based On Value Of Adjacent Cells

Feb 20, 2014

What I want to achieve: those cells have number 1 ( in column E) , adjacent cell values ( In Column D) are copied to G12 in the following format:: Mark,Lark ( i.e. cell value , cell value, etc)

is it possible ( with a command button) Sample attached

View 4 Replies View Related

How To Copy Cell Range Based On Individual Cell

Mar 15, 2014

I have a spreadsheet (book1.xls) that has a column with 13 names down the side and 31 other rows (dates of the month)

Mike1 1 2 3 4 5 6 7 8 9
Mike2 1 2 3 4 5 6 7 8 9
Mike3 1 2 3 4 5 6 7 8 9
Mike4 1 2 3 4 5 6 7 8 9 etc

I have selected all 13 rows and 7 days and named them 'week1', and the next 7 days 'week2', the next 7 days 'week3' etc/What i want is to display the named range based on a single cell selection based on a cell value in a different sheet.

The basics of it should be "If cell C1 = 1 then show me 'week1' or if cell C1 = 2 then show me 'week2' etc.

View 4 Replies View Related

Macro To Copy Row And Change Value Of Cell Based On Cell Value?

Oct 7, 2011

Basically, I need to reformat a set of data (see before and after). A specific column should only contain 1 value, if there is more than 1 value it will be separated by a comma. If this column contains more than 1 set of data then I would need to insert a row and duplicate the information based on how many different sets there are. All the copied data should remain the same with the exception of the "Key" column, it should only have 1 value and each copied row should contain the corresponding value in the key field.

BTW - it could be on the same sheet or a different worksheet (doesn't matter)

BEFORE
Name Number KEY Date
Name1 1 a,b,c 12/1/2011
Name2 2 x 12/1/2011
Name 3 5 one,three 12/1/2011

AFTER
Name Number KEY Date
Name1 1 a 12/1/2011
Name1 1 b 12/1/2011
Name1 1 c 12/1/2011
Name2 2 x 12/1/2011
Name 3 5 one 12/1/2011
Name 3 5 three 12/1/2011

View 2 Replies View Related

Formula To Return A Cell Location Not Cell Value?

Jan 31, 2013

Is there a standard way across all Excel formulas to have the cell location returned rather than the value of the cell itself?

In other words A33 instead of "52" (with A33 being the cell that contains "52")

View 1 Replies View Related

Increment Cell Location Up By One Cell For A Column

May 21, 2009

Increment all cells located in Column H up by one (the one above it) cell Except for the header cell (since its the header)(H1),

H2 will always be a blank due to the make up of my database so that will not cause the header to be re-written.

Column H is not an entirely filled column and some cells are empty (if this info was needed in optimizing the code),

Im seeking the quickest and easiest way of implementing this since the database is very large.

View 2 Replies View Related

Find Cell Location With Equal Value Of Another Cell

Jul 11, 2012

code that will go to a cell in Sheet1 column A that has the same or closest value to cell B11 in another workbook. The number values in the column are to three decimal places and the run in order down the column from lowest value to hightest.

View 6 Replies View Related

Copy And Paste Row By Cell Value Criteria

Jun 4, 2008

I am trying to copy and paste Row by cell value. It is working fine when I am copying row from one worksheet by comboBox value to other worksheet. But problem is after updating data when I want copy back by cell value, it is showing "Run-time error '1004'" - Application-defined or Object-defined error. the code below is working fine

Private Sub CommandButton1_Click()
Dim sfind As String
Dim cl As Range
'check for a value & show message
Sheet = "Data"
Sheets(Sheet).Select
Application. ScreenUpdating = False
If Me.userIDCombo.Value = "" Then 'the textbox in userform
Me.userIDCombo.SetFocus
MsgBox "Please enter a Name to Update."
' show message if no Name Selected
Exit Sub
Else
sfind = Me.userIDCombo.Value.........................

View 2 Replies View Related

Copy Cell Data Based On Value In Another Cell

Nov 28, 2012

I have values in column C1:C10 that are 8,9 or 10 (representing the months of August, Sept, and Oct). I need to copy a value that occurs in column I if the value in the same row in column C is 8.

E.g. if the value in C1 is 8, then copy the data in I1 to a separate column, and so on for each row in column C.

View 1 Replies View Related

Copy Cell Based On Empty Cell In Same Row

Sep 10, 2013

I need to copy a cell into another spread sheet contingent on whether or not another cell in the row is empty.

For example, I need to copy cell A5 because D5 is empty.. However, if D5 was not empty I would not need to copy A5.

I don't need this macro to loop.

View 2 Replies View Related

Copy And Paste Row Of Data Where Cell Contains Criteria

May 8, 2008

I need to be able to search column y and rows 5-100 and where cells contain "A" copy and paste entire row to row 110. I am guessing it is really simple but I am obviuosly missing something

View 3 Replies View Related

SUM Based On A Criteria And Another Cell Being Blank

Apr 23, 2009

I need to create a formula that counts up the number of times a specific word is put into a cell lets say 'Carpet' only when another cell is left blank.

Count the number of times between C1:10 the word 'Carpet' is input only when D1:10 is left BLANK?

If looked into DCOUNTA formulas and SUMPRODUCT formulas but seem to be clutching at straws.

My problem seems to be at referring the formula to the BLANK cell?

View 5 Replies View Related

If Statement Based On Various Cell Criteria

Aug 11, 2009

G5 - can contain True or false
G6 - contains text but the if is on the basis of this cell being "Hand Delivered" or not

I have tried the following to illustrate what I after:

View 2 Replies View Related

Populate Cell Based On Two Criteria?

Aug 2, 2013

I have a list of teams, and beside them I need a calculation to be filled.

The criteria is based on a cell reference (a month which can be changed from a drop-down in BM2) and also the name of the team.

dummy 16.xls

View 5 Replies View Related

Penalty Based On Criteria In Another Cell?

Sep 28, 2013

In my country, students are penalized when they fail Mathematics subject. That is when a student gets "F" in Maths. The penalty is only for those scoring Division I and II. The divisions change into Division III for those penalized but points remain the same. For example if a student ie Juma gets Division I of points 17 and he fails Maths, he should be penalized and get Division III of points 17. NB: Those who score Division III,IV and 0 are not penalized even though they fail maths.

View 5 Replies View Related







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