I have a column on sheet 1 which contains 200 lines with a unique number in each row (account codes). I have another sheet (sheet 2) which contains the same column. sometimes an extra row for an extra account code is added to the col in sheet 1. I need to make sure that the col I have in sheet 2 always has exactly the same as the col in sheet one, where the same account code should never be repeated. I am currently trying to setup a sheet where I keep all the checks and controls.
If a number in cell M1 is also anywhere in column A (column A has unique numbers), then cell W1 (date) should equal the content of cell V (also date) in the row that that number appears in column A. If M1 is blank (or there is no match in column A), then W1 should equal V1.
I have a table as follows: [URL] - note: cells containing times and temperatures are numeric values, I've used custom formatting to add " mins" and "°C" on the end
In one cell, a user can input a time period (in mins), and in another cell, I would like to output the start and end columns (in letter/s) for the chosen time.
For example, in the link above, if the value inputted '30' then the start column is 'C' and the end column is 'G'. If the user had inputted '60', then the results would be 'H' and 'K', etc.
I am able to find the start column with the following equation: =SUBSTITUTE(ADDRESS(1,MATCH(VALUE,C2:P2,0)+2,4),"1","")
I am struggling, however, to find the end column for the chosen time.
If each time had the same number of temperatures then it would be a simple case of adding the number of temperatures per time, minus 1, after the "+2".
My first idea was to copy the above function, but to change the "0" in the MATCH function to "-1", in order to find the next greatest time value. However, it appears that using "-1" in the MATCH function only works if the range is in descending order - my times are always in ascending order.
I have a further problem in that the time periods are not always the same values (i.e. it won't always be 30-60-90-120, it could for example be 30-45-60-75). So as far as I know, there is no way in advance of knowing the next time period up (and then subsequently taking one column to the left).
One possible workaround I have considered involves the following: - Add a new row between rows 2 and 3, which has the time values in each cell (i.e. from column C, values of 30-30-30-30-30-60-60-60-60-90-90-90-120-120) - effectively duplicating the time row, but not merging cells - Use the COUNTIF function to find the number of cells in that row containing the chosen time - Add this value, minus 1, after the "+2" in the above formula, i.e. =SUBSTITUTE(ADDRESS(1,MATCH(VALUE,C2:P2,0)+2+COUNTIF(C3:P3,"="&VALUE")-1,4),"1","")
I am looking for some VBA programming that will allow me to use 1 button to consolidate rows (delete them). The problem I am running into is that the rows I want to delete have formulas in them so I can use "find all blank cells & delete" type of macro.
Attached are a couple of brief images on a small scale what I am looking to do.
I want a user to be able to have this sporadic list of choices, consolidate them so the are all one right after each other, then export to a word file for editing later on.
I would like a formula that will take the info from 2 cells (not adjacent to each other or in the same row) and then look these up in a table giving the answer in the 3rd column somewhere else on the worksheet.
combining multiple rows of related data into one row but have not seen one that matches my situation. My experience level with excel only includes some basics like vlookup, match and recorded macros, although I have used vba code for a macro that met my needs. I have a parts list for a PCB that has many different parts. Some of the parts are used multiple times across different reference designations("Reference" column in the file). I have shown a desired format and the original format below. Since the item number has blanks across the reference designators I haven't found a solution that would work for me.
I want to delete a row in a spreadsheet by finding the row that contains a particular value. I use MATCH on spreadsheet #1 to identify the row number on spreadsheet #2 to delete. I need the macro to select the row number on spreadsheet #2 and delete it.
I don't know the syntax for the commands in VBA to write this and I'm coming to this forum for help because I'm too lazy to learn VBA. I've recorded macros to add rows, populate cells, hide sheets, etc. The following code is extracted from a macro I recorded to try to get started, and was hoping to be able to substitue a reference to sheet1 within the parentheses at
but I can't make this work. The following is the code I was trying to adapt.
Sheets("Sheet2").Select Rows("4:4").Select Selection.Delete Shift:=xlUp End Sub
I have been using this macro to separate lots of rows with a certain amount of blank rows.
Code: Sub test() Dim j As Long, r As Range j = InputBox("type the number of rows to be insered") Set r = Range("A2")
I trying to change it so that, instead of inserting how ever many blank rows, it just copys the row above.
Example (Row A to C)
I have been messing around with macro recorder and i could select each row and paste it into the blank rows, but from researching on the internet selecting and pasting data seems to be a waste of resources (ram?) and i will be running this on a couple hundred rows (lots of data). Also, i would like to keep the functionality so that i can still choose how many times it copys/inserts each individual row from a input box.
I eventually want the data to end up like it is shown in the table but i am takin it one step at time because i want to understand what the code is doing.
I am currently working on a project where i am given a sheet that typically has several hundred rows of data and not seemingly organized in any manner. This document has 6 columns, and my main focus is a range of dates (in MMM-YYYY form) from around early 2000 to now that can have duplicates. The dates(Column C), have corresponding Usages (Column D), and Costs (Column F) and I need to add these values together and remove the duplicate months so I only have one Usage and one cost Per month.
My spreadsheet has 6 Columns of data, and varying number of rows. Currently, since I receive the numbers in an unorganized fashion, my macro organizes the data into a table and then sorts the table be date so I have the oldest dates first and the duplicates are adjacent. There may be varying numbers of duplicates, though typically 0 to 4.
Given that a worksheet has frozen rows and/or columns, how do you programmatically determine what they are?
There are plenty of examples around that tell you how to create frozen rows/columns by setting ActiveWindow.FreezePanes = True but, given this is only a Boolean value, reading it does not tell me where the freeze is.
Data file with few columns. There are groups of similar ID numbers in Column J. For a group of similar ID numbers in consecutive rows there is only one row that has a number greater than 0 in its Column L cell and the rest of the cells of Column L for that set of similar IDs is filled with 0s.
First for that unique ID group I need to find out which row is it that has a value greater than zero in its Column L cell.
Then I need to use that value to fill the rest of the 0s in Column L corresponding to that set of Unique IDs.
The process continues with identifying similar IDs in Column J and this time doing the same thing for their Column M. I have attached a sample file that shows the data and how the results need to look like.
I created a macro that analyzes some datasets and according to different parameters it puts an X at the side of every cell that goes out of parameters. These Xs are all in columns named the same way for it to be easier to find. What I want to do is to write some macro that will hide every row where the data did not go out of parameters to be able to easily see where it did. In the following example it would need to hide the second row since there are no Xs in that row. One of the problems I'm having is that the amount of columns and rows is variable.
Data Data Functional Upset Data Data Functional Upset
# # X # #
Below is the piece of code that I created to try to do this (G has the value for the amount of rows). I think it is working but it is either taking too long since it has to sometimes go through over 20k lines as much times as it needs to to cover all the rows that contain Xs or its getting stuck for some reason.
Code: Worksheets(2).Range("I3:I" & G).EntireRow.Hidden = True K = 0 Do Until Worksheets(2).Range("I1").Offset(0, K) = "" If Worksheets(2).Range("I1").Offset(0, K) = "Functional Upset" Then
I am trying to count the # of rows in a spreadsheet in which there is non-blank text data in 2 separate columns. For instance, if the spreadsheet looked like the one below (dashes just for formatting purposes):
NAMES-------THIS-------------THAT Mary-------some text--------some more text John-------<blanks>---------just text here Sue--------just some here-----<blanks> Dave-------something--------something else Adam------<blanks>-----------<blanks>
The total # of rows with something in both the "THIS" and "THAT" columns above would therefore be 2.
I have a code in software that exports results to excel. But it stores the numbers associated with indices as text. I need to change all of them to numbers. So I have written the following code, that search through the folder, converts text to numbers and colses the file.
Sub ConvertText2NumberFiles() Dim v As Variant Dim rng1 As Range, bk As Workbook Dim i As Long ChDrive "C" ChDir "C: ...analysis"
The problem is it takes time becuase it is going through A LOT OF cells. I only need at most the first 4 columns and the first 2 rows. So I wanted to use the union. I wrote the following:
Set IndexColumns = bk.ActiveSheet.Range(Columns("A") & ":" & Columns("A").SpecialCells(xlLastCell)) Set IndexRows = bk.ActiveSheet.Range(Rows("1") & ":" & Rows("1").SpecialCells(xlLastCell)) Application.Union(Range("IndexColumns"), Range("IndexRows")).Select
Which doesn't work! Morover it is only for one column and one row.
NOTE1 : Like any matrix, the intersection of index columns and index rows is blank! NOTE2 : The lenght of indices is different from one file to another
I'm importing some data from an HTML table into excel, it all formats pretty well except that some of the data appears on multiple rows.
A B C 1 01.02.06 John 2 Bob 3 Sam 4 02.03.06 Jim
What I need:
a b c 1 01.02.06 John, Bob, Sam 3 2 02.03.06 Jim 1
What I need to do is get all the items in the colum B which are listed under the same item in column a, in the first case John Bob and Sam and put them all into the same cell. I then want to delete the empty rows. It's important that this is done by testing to see if column A is blank, rather than using the date.
then in column C I want to count the items in column B, ideally then repeat the script for the whole sheet.
Not a clue of the type of syntax I should be using though! In fact there's probably a better way of importing the data from the HTML so it doesn't even need to be done this way! of course I'm oblivious to it. Auto Merged Post Until 24 Hrs Passes;Thinking maybe I didn't make myself properly clear....
If a cell in column a is empty then it means the item in column b needs adding to the end of the item in the row above in column b.
I have a data set which has 6 columns (and lots of rows). Every row is different but I want to aggregate them based on 4 fields and then find the average of the numerical column for the results. I basically want to Group based on 4 fields and find the average of the 5th field.
My initial approach was to introduce a column which is a combination of the 4 fields I want to group by, simply in the Excel file (=A2&B2&C2&D2) and then find duplicates of that. I have a solution for this in VBA but when importing new data sets in this method is very slow, so I want to be able to do the whole thing in VBA.