Automating Entries In Column Adjacent To Pasted Selection
Jul 17, 2013
The following code inserts the text "ep" into col. F when an entry (formatted text colour green) is made in the corresponding row of col. B:
VB:
Private Sub Worksheet_Change(ByVal target As Range)
' Insert "ep" in Type column and set font colour
If target.Column = 2 And target.Font.ColorIndex = 10 Then
With Cells(target.Row, "E")
.Value = "ep"
[Code]...
However, more often than not new entries are made by pasting from another sheet, and usually more than one row. How can the code be modified to count the number of rows in the pasted selection and place "ep" in each corresponding row of col. F (instead of just the top row)?
I've been trying Selection.Rows.Count but keep getting the dreaded error message, "Object doesn't support this property or method".
View 6 Replies
ADVERTISEMENT
Sep 17, 2013
Im trying to make an excel spreadsheet for work for working out how many of each product and individual staff member has sold
I have 2 columns one with staff and one with what they sold e.g.
Staff Member - Sales
Staff 1 - prod A
Staff 2 - prod B
Staff 3 - prod A
Staff 2 - prod C
Staff 1 - prod A
and have another table, the one that i want to populate, that looks like this
Staff 1
prod A =
prod B =
prod C =
Staff 2
prod A =
prod B =
prod C =
etc
I cant seem to find a function that will work out how many of prod A staff 1 has sold and how many prod B he has sold etc
i have tried things like countif but i cant seem to get them to link the staff member and sales boxes together, the only way i can think of is to write down an equation for each line, but i have hundreds of sales and that would takes ages
View 3 Replies
View Related
May 7, 2014
What I need to do is sort certain entries in longer list (column A, it is in .csv format and needs to be in it so coordinates and names and ID, all sorted with commas) and I have another list (column C) which is shorter list of certain IDs. I googled and tried and got some results for the basic structure but the fuction seems to fail. It doesn't matter how I get that third list done, but there is only one criteria: since the list in column A is really long and those entries need to keep the .csv formatting, the function should copy that info what is in the matching cells.
Let me try to put it simple: .csv cells from column A that have matching ID from column C should be copied to column B (or N).
the function I'm working with right now is
=IF(ISERROR(FIND($C:$C; A1))=TRUE;"0";A1)
View 13 Replies
View Related
Feb 10, 2009
I have to enter patient's SSN's into my database. The fastest and most error free way to do this is simply copy the SSN from the electronic chart and paste into the appropriate cell in the database. I don't want duplicates. So, I need the database to alert me when I paste in a duplicate SSN. I know you can set data validation to do prohibit duplicates by using a formula. In the attached spreadsheet the SSN is in column B, so:
View 3 Replies
View Related
Apr 12, 2013
I have a workbook that has two worksheets. One worksheet is an input worksheet. A user will select a date from a drop-down list and type in the events that occurred on that date in 8 adjacent cells. The user selects a button that advances date and clears form. On sheet 2, whatever was typed into sheet one is saved via VLOOKUP formula. However, if I try to change something retroactively and select a previous date from the drop-down list, it clears everything in sheet 2 that was typed for any selected day.
View 1 Replies
View Related
Dec 4, 2013
I have scoured the net for the following and have not been able to find a solution. I have found variations but not something specific for the use needed here.
I have attached a file with sample data which has the following format.
Column 1 = vehicle model (in this example golf, jetta, but there will be over 100 choices)
Column 2 = vehicle package option for specified vehicle model (automatic transmission, manual transmission, automatic transmission with air conditioning, etc...)
Column 3 = vehicle colour available for vehicle package option
Please note that Column 2 values for 'golf' are different than values available for 'jetta' (in the sample data I have blocked out common values with the same colour for quick and easy identification)
Also please note that Column 3 values of colour options vary for each 'vehicle package option'.
The behaviour that would be ideal is to have 3 drop down menus. The first drop down menu will allow selection from column 1 and will show each model only one time and repeated values will not be shown. The second drop down menu will only show the options available based on the selection in the first drop down menu. Likewise, the third drop down menu will show the colour options available based on the selection in the second drop down menu.
Since my data will involve hundreds of unique values in column 1 with plenty more added over time, it seems that the format of the data and the way it is laid out in the attached sample is the easiest way to organize it. It is perhaps also the easiest way to include new data without a lot of reprogramming.
Sample Data - Dependent Drop Down Cells Question.xlsx
View 8 Replies
View Related
May 29, 2014
I have a list of data and I want to identify the unique entries for both columns but the second column has to unique to the unique values in the first column.
Example List
Fruit
Color
Apple
[Code]....
View 9 Replies
View Related
Jun 6, 2014
Any way to construct a formula in excel that will look at a reference in one column and find the latest date from the data in an adjacent column for that specific reference?
Below is an exctract from a much larger sheet of the columns in question.
The result in the last column should be 21/05/2014 for anything with D.O.001 in the second column and 15/05/2014 for anything with D.O.002.
Date Decision agreed
Disposal Order
Latest Decision date for D.O.
06/05/2014
D.O.001
[Code] ........
View 6 Replies
View Related
Dec 20, 2013
Formula(s) to do as explained in the attached example.
Example_formula.xlsx
View 9 Replies
View Related
Mar 5, 2014
I need a formula to run down a column DCapture.JPG (starting at 142), when it finds the last entered value it needs to display the corresponding value from column J into cell AA21.
If you see the attached photo, the last entered data in column D would be 1, AA21 would be saying -30 (J205)
Capture.JPG
View 6 Replies
View Related
May 20, 2008
I have a worksheet on which the data is already grouped. At the top of each group is a row that contains only the group name. Since the rest of that row is blank, I want to use a blank cell on that row as a reference, then copy the group name to a newly created column, then fill that column down to the next group.
The goal is to create a column that contains the group name, rather than just having the group name as a " header" at the top of each group.
View 5 Replies
View Related
Apr 10, 2014
I need to sum values in a column, but only if the text in the same row of the adjacent column meets certain criteria. Below is a simplified version as an example:
A1 - Apple
A2 - Banana
A3 - Apple
A4 - Banana
B1 - 3
B2 - 2
B3 - 1
B4 - 1
I need a formula that will add up the cells in column B that have "Apple" next to them in column A. Apple would total up to 4 and Banana would total up to 3.
View 1 Replies
View Related
Jan 13, 2008
I am trying to get an average from one column based upon criteria from an adjacent column. The number of days to close a case for race columns Black and White are listed in B5:C16 and E5:F16 and H5:I16. I need a formula to calculate the average days taken to close cases for Males and then the same for Females. Sample below: ...
View 12 Replies
View Related
Mar 25, 2008
my existing macro, as the run takes to much time to complete. (at least 20min) I've already tried several loops, but no one worked for me. Following situation: There are two excel files, entries in column 73 - 85 will be copied from WorkbookRust to the other workbook if the numer in column 5 is the same. Not every cell within this columns contains data, so the macro should automatically jump to the last entry in each of the above mentioned columns, instead of predefine the range as you see in the code below. After the data is copied to the other workbook, it will be filtered acc. to Sub FilterMain and then copied back to WorkbookRust. As already said, the whole thing works, just to lame.
Sub Allmacros()
Dim WorkbookRust As String
WorkbookRust = ActiveWorkbook.Name
ChDir "C:Documents and Settings vogtMy DocumentsRüstplausch"
Workbooks.Open Filename:= _
"C:Documents and Settings vogtMy DocumentsRüstplauschCH_Revenue_2008.xls"
Sheets("Main_Overview").Select
Windows(WorkbookRust).Activate
Application.run ActiveWorkbook.Name & "!UpdateEntries"
Application.run ActiveWorkbook.Name & "!FilterMain"
'not ask to overwrite existing file
Application.DisplayAlerts = False
Workbooks("CH_Revenue_2008.xls").Save
Workbooks("CH_Revenue_2008.xls").Close
End Sub
Sub UpdateEntries()......................
View 7 Replies
View Related
Feb 27, 2009
Im wondering if this can be done in excel..
2 columns
if the value in column O=$0.00 then I need to divide the adjacent cell in column L by 0.3 or multiply by 30%
this is the way I was trying to do this...
=IF((O2:O6722)=0,DIVIDE(L2:L6722).3)
I have tried it several different ways and cannot get it to work - is it my formula or can this even be done because I can't reference just one cell?
View 9 Replies
View Related
Sep 27, 2007
I had a problem finding something then deleting the column, I tried to alter the code from that thread to solve a new problem and I am close (I think), but not quite there. I need to find the column "Group" and merge it with the column "Sex" which is offset by 1 column. This code will go through and find the column "Group" and merge for the first cell, but will then get stuck in a loop just concatenating "Sex" to the end continuously. I need it to concatenate both columns entirely together. Any simple fix to what I modified? Previous thread should you be interested:Find Part Text On All Sheets & Delete The Column.
View 9 Replies
View Related
Jan 30, 2008
I have are two worksheets, "Sheet 1" which is a bill of lading form and "Sheet 2," in which columns A and B contain Part Numbers and Weights respectively.
What I'm wanting to have happen is when a user inputs a part number into Sheet 1 (say in cell B6), it calls a UDF that looks up the part number on sheet two column A and returns the corresponding weight from column B (to say cell C6 on sheet 1).
View 7 Replies
View Related
Oct 9, 2009
I have a Listbox that outputs data to Column A. Is there a way to auto populate Column B with 4 items for each Entry in Column A?
The 4 items that will populate in Column B will always be the same.
I have attached an example to better explain what I am trying to describe.
View 6 Replies
View Related
Feb 20, 2009
Let's say I have a dataset with blank or X in column A, and a dollar value in column B. I want to sum the dollar amounts for column B only if there is a corresponding X in that row in column A. The way I currently do that is by creating a new column C, making a if statement to display the value of B only if there is an entry in A, and then doing operations on that new range. I figure there has to be an easier way. I don't know how to use VLOOKUP, despite trying to read the helpme a bunch of times. Is that relevant?
View 8 Replies
View Related
Apr 22, 2014
In the B column i have dates. In the C column i have total hours.
Right now the following code counts how many instances of a date (Dt) are found and makes a decision if it is more than 3.
VB:
IVAL = Application.WorksheetFunction.CountIf(WS.Range("B:B"), Dt)
If IVAL > 3 Then
What i need is to SUM the hours (C column) for each instance of the date (Dt) in the B column, and test if it is greater than 24. so it would be similar to this:
VB:
IVAL = Application.WorksheetFunction.SumIf(WS.Range("C:C"), Dt)
If IVAL > 24 Then
Except that this code attempts to sum the hours of the C column and also wants to recognize the dates from the C column which would not work. I need something different than SUMIF. I need it to Sum the C column for the appropriate dates (Dt) in the B column.
View 2 Replies
View Related
Jun 20, 2008
I have a spreadsheet with a list of account numbers and values(sheet1) and on a seperate sheet (sheet2) a list of all unique account numbers that appear in the transaction data sheet.
What I am trying to do is get a total sum for the values of each account number. What I am getting well I'm not quite sure what I'm getting. The problem appears to be when the xSubtotal variable is reset to 0 at the end of calculating all the values for the account number.
View 6 Replies
View Related
Feb 4, 2014
The first two columns are an example of my data set; I would like a formula for the 3rd column (Length+1) which will give me the length at the next age (i.e the value in the cell below in most cases) unless the following age is 1 in which case I want it to return zero.
Age Length Length+1
1 22 51
2 51 78
3 78 94
4 94 0
1 31 46
2 46 69
3 69 85
4 85 96
5 96 103
6 103 0
1 19 36
2 36 52
3 52 0
View 3 Replies
View Related
Mar 4, 2006
I have two columns with multiple sets of data, based on the entered value I
need the corresponding header returned.
For example:
Column A Column B
Apples Green
Red
Granny Smith
Mutsu
Red Delicious
Oranges Naval
Manderin
Clementine
Tangerine
Now based on a response in another sheet I need to return either "Apple" or
"Orange".
=INDEX('Fruit'!A1:A65535,MATCH(K50,'Fruit'!B:B65535,0)) will work if I copy
Apple next to each apple type, but for other items the list of options can
grow dramatically.
View 9 Replies
View Related
Dec 19, 2013
When I record a macro I use the paste down feature, but in the code it just sets the paste down to the last cell and sets that number in the code.
What do you put in the code so it finds the NEW bottom of the column when the columns get longer or shorter? I tried recording in relative reference and that did not do it - what's the trick?
View 2 Replies
View Related
Mar 5, 2014
I want to write some VBA code that simulates the double click of the square in the lower right of a selected cell. When you double click it, it fills every cell in column A until the first blank in column B. I was able to find this code searching around:
Code:
Selection.AutoFill Destination:=Range("A10:A" & Range("B10" & Rows.Count).End(xlUp).Row)
Selection.Copy
The issue with the above is that it copies the data all the way down to the LAST row in column B with data.
I want to have the macro stop when it finds the FIRST blank cell in column B.
Just as an example, the last row of data in column B is 100, but in row 67 the cell is blank, so I want it to stop at row 66.
View 2 Replies
View Related
Feb 21, 2008
I have a substantial schedule that has been completed by a 3rd party who has used the comment function for important data. Can anyone suggest how i can utilise a macro to extract all of the comments into the adjacent column?
The comments are currently against cells in column E and i'd like to extract them to blank cells in a newly inserted column F.
View 9 Replies
View Related
Jan 15, 2010
Sub For_Adam()
For x = 1 To Range("G7")
Calculate
Range("G11").Select
Selection.Copy
Range("B15").Select
ActiveCell.Offset(x, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next x
Application.CutCopyMode = False
End Sub
Now all I want is for this to be repeated in the next column, so everything is exactly the same but it doesn't start in B15, but starts in C15, then D15 etc.
View 9 Replies
View Related
Apr 14, 2014
I am trying to find a solution for highlighting cells in a column that are repeats, ie. >3. I also need these cells to only be highlighted if the adjacent cell in the next column contains specific text. I have tried using conditional formatting with a countifs formula to no avail.
View 2 Replies
View Related
Apr 10, 2014
I am trying to make printable book labels in one worksheet based off of values from another. The labels that I have are standard address sized and come in sheets with 3 columns and 10 rows. My "label" worksheet has 5 columns (with B:B and D:D as "spacers") I made a "calculation" worksheet that simply runs the equation I want to use for the labels from A1:A1000. On the "label" worksheet, I have this formula in cell A1:
=IF('Label Calculations'!$A1="","",'Label Calculations'!$A1)
This way, it won't return 0s for blank cells from the "calculations" worksheet. I dragged down the formula to cell A10, but would like to continue the pattern so that cell C1 would be:
=IF('Label Calculations'!$A11="","",'Label Calculations'!$A11)
and cell E1 would be:
=IF('Label Calculations'!$A21="","",'Label Calculations'!$A21)
and the pattern would continue with cell A11 with the formula:
=IF('Label Calculations'!$A31="","",'Label Calculations'!$A31)
Then cell B11 would be 41, C11 would be 51, A21 would be 61, etc.
I can do it manually by adding the function in the top row of each "page" (A1,C1,E1 then A11,C11,E11...) and dragging them down each "page." However, I may end up with 20 some pages of labels. I feel like there should be an easier way I can do this.
View 4 Replies
View Related
Aug 14, 2014
Have 2 columns of data
Need to read the cell value of column A that corresponds to the MAX in column B. Trying to use OFFSET to read the col to the left but will not work.
Example of table and expected result
A B
1 1
2 1
3 2
4 6
5 3 Result = 4
View 3 Replies
View Related