In the attached file, details sheet contains multiple instances of project with associated costs for each of 2006, 2007 and 2008. What I need is a formula (preferably) or a VBA that select distinct project names and populate column B of summary sheet so I can do a sum if. The problem is the project names changes dynamically every week and they are practically in hundreds.
I need to select the whole column ABOVE the active cell. Ctrl-Shift-UpArrow is no good because it stops at the first blank cell. And selecting the whole column is no good either because when I subsequently paste into the column, it pastes in all the empty cells of the column, meaning my worksheets expands from a few hundred rows to 1 million!
Shift-Home does what I want on rows. Is there an equivalent for columns?
augmenting current code to select the column after a column. Current code is:
Code: If Sheets(data_sheet1).Cells(2, iCol).Value = "Stations" Then TargetCol = 1 If Sheets(data_sheet1).Cells(2, iCol).Value = "Agency" Then TargetCol = 2 If Sheets(data_sheet1).Cells(2, iCol).Value = "Advertisers" Then TargetCol = 3 If Sheets(data_sheet1).Cells(2, iCol).Value = "Product Code" Then TargetCol = 4 The next line should find the column after "Product Code".
I have a table of numbers to which a new number is added every day. I want to reference the last value in a separate cell. For example, in cell A1 I want to insert a formula that will look at Column B and select the last value. The values in Column B wil be added to each day, ie a new row will be inserted.
I am creating a spreadsheet to manage Block ID conflicts when adding mods to a Minecraft Server. Example spreadsheet is attached.
Description: Column A contains a list of available numbers (e.g. 1-20 and 31-50). Column B contains a list of numbers a new mod tries to use up by default (i.e. 1-25). A number in Column B that is not in Column A must be changed to the nearest number that is in Column A. In this example, numbers 21-25 in B are not available in A and must be changed to 31-35, respectively. Column C should be the result of changing Column B (i.e. 1-20 and 31-35).
Issue: The main problem is that as a given cell in Column B changes, that number needs to become unavailable in Column A for the next change. For example, when 21 in B returns 31, 31 can no longer be used for the next number in B (22).
I have been able to use VLOOKUP or INDEX/MATCH functions to lookup the numbers to be changed.
I putting together a spreadsheet that applies Payments (as they come in) against the oldest open invoice. As payments come in, old invoices are closed out. An aging is done and late fees are applied.
I have made a macro that inputs all of the information of the invoice in a list. However, when a payment comes in, I am trying to write a macro that:
1) in column G - Finds the first non-zero balance 2) Applies the payment amount to that open invoice. If there is additional funds left over after the satisfaction of that invoice, I would like the payment to be applied to the next open invoice until all the funds of the payment have been drained.
I am having so much trouble trying to even just locate the first nonzero balance and select it.
I have a worksheet which already has some built in formulas which take the data in columns V and W, and use them to build other coding in column P. The trick is that the coding created in column P will be six times as long as the source data in columns V and W.
I.e., a single row containing "Sample1" and "Sample 2" in columns V and W respectively create the six following rows in column P:
I want to be able to select the accurate length of Column P, which should be 6x as long as columns V or W. Any dynamic way to do this? (Since the amount of data pasted into columns V and W will change each time I use this worksheet.) I know how to select set ranges, but not how to adjust them as multiples of the length of another column
I want to select a range of rows 11, 14 and 23 to 24 in column j, plus the 2 rows to the right of column J and run a sum formula on the range. My procedure is selecting rows 11/14/23/24 and doing the sum for only column J. How do I make it so it runs the sum formula on all 3 columns. My code is copied below. I am fairly new to VBA.
Code: With ActiveSheet.Range(Cells(27, j), Cells(27, j)).Select Set sumRng = Intersect(Range("15:21, 25:25"), Columns(j)).Offset(0, 2) ActiveCell.Value = WorksheetFunction.Sum(sumRng) End With
With wsSheet.Range("A:A") ReDim MyArray(1 To .Rows.Count, 1 To .Columns.Count) MyArray = wsSheet.Range("A:A") For i= 1 To .Rows.Count For j= 1 To .Columns.Count wsSheet.Cells(i, j+ .Offset(0, 3).Column) = MyArray(i, j) Next: Next
I want to select alla values in column A, but when I specify the range as "A:A" the code results in an infinite loop! How can I come around this?
I have a workbook that generates sheets for each year based on selected criteria. It starts at Column H and goes too AH and beyond. When my loop reaches Z it errors out. I think this is happening because the code is referencing the column as ASCII. Here is the
Sub Test() Dim d As Date Dim yrint, i, num_years, fields, field_start As Integer Dim yrstr, crit1, crit2, left_column_range_fixed, right_column_range_fixed, left_column_range_var, right_column_range_var, left_column_range, right_column_range, cost_column, cost_column_var, cost_column_fixed As String left_column_range_fixed = "H" right_column_range_fixed = ":AH" cost_column_fixed = "2" crit1 = "=x" crit2 = ">0" d = Date yrint = Sheets("Overall"). Range("H2") field_start = 9 'changed from 9....................
The match results are posted on another sheet and the winner allocated the letter W and the loser allocated L (in the sample workbook attached these are on sheet2 cells B1 and B2 with the winners name in A1 and the losers in A2, i.e. Bill and Susan) I have the code for this working properly.
What I need to do next is transfer the W and L onto the grid in sheet1 and insert the W in the cell that is the intersection between the row with the winners name and the column with the losers name. Then insert the L in the cell that is the intersection between the row with the losers name and column with the winners name. I hope that makes sense!
If it is simpler to insert the W and L into the grid directly from the winner and loser names in sheet2 col A rather than allocating the W and L in col B first, then that is great.
I have a code that inserts a new column after every 7th column. I want to include a formula where every 7th column value is subtracted from the values present in the column before the 1st, or you can think of it as subtracting 7th column of the present group from the 7th column of the previous group. Example: The range of my data starts from col F, then
F (7th) New Column (G) H (1st) I (2nd) J (3rd) K (4th) L (5th) M (6th) N (7th) New Column (O) P (1st) Q (2nd) R (3rd)
So, New Column (O) = N - F and the next New Column (W) = V-N ...
NOTE: Column G can be ignored.
I want to add a looping function to this so that it will continue to subtract for the other respective columns as well. How do I incorporate this into the following code?
I have a column that has mostly empty cells. I want to select only the ones that have data so I can perform an operation on all of them. Empty cells must be excluded from selection. I do not know where the bottom of the data is.
The solution needs to be in VBA where it is part of a larger macro affecting the user's worksheet.
I am inserting a subtotal above my data set, the first cell that this subtotal takes place is "R1", then I have an unknown number of subtotals going right, depending on the number of months FCSTed by my sales managers.
Attached you will find a subset of the data and you will see that I need to select "S1 : iLastColumn(1)".
I have a worksheet which is created monthly by one of our company's employees which reports results for that months operations and successful audits. These audits are separated into various service lines and on the report which is submitted it takes on the following format:
1|Service Line|Data A|Data B|Etc. 2|___CR_______| Data | Data | Etc. 3|____________| Data | Data | Etc. 4|____________| Data | Data | Etc. 5|____________| Data | Data | Etc. 6|___DD_______| Data | Data | Etc. 7|____________| Data | Data | Etc. 8|___MS_______| Data | Data | Etc. 9|____________| Data | Data | Etc.
What I want to do is use a macro from another sheet that has the effect of: While ServiceLine = "CR" copy the row of that line and move it to my monthly summary workbook, sheet 1. Then when the Service line changes to DD have the macro copy that information to the monthly summary workbook sheet 2, and so on. The problem is, if I test the Service Line column each time it will be an empty string the majority of the time and I'm not sure how to combat that with my If, Do, For, and While statements. As I've thought about it there are two solutions that I can think of: someone knows of a way to test the row only if it has information in it, or if there is a way that I can copy the service line information down until the change in service line so I can test Service Line on each Row.
I am trying to write a macro, where I want to pick up alternative cells in each column from Sheet 1 and then Paste in Sheet 2. Each column starts with end of every year ( 31st Dec 1996 and so on. My data in sheet for each average column (for different years) is like this.
Average Closing Price 26.47
Stock Return -0.68
I want the value for stock return to be pick up different columns ( for each year) then paste in sheet 2.