Select Every Other Row :: Alternate Rows
Apr 5, 2002Im trying to find a way select several rows at the same time but starting at say row 3 and then alternate rows so rows 3,5,7,9 etc
View 9 RepliesIm trying to find a way select several rows at the same time but starting at say row 3 and then alternate rows so rows 3,5,7,9 etc
View 9 Repliesi have this code which inserts blank rows in alternate rows,
Code:
Sub insertrow()
' insertrow Macro
Application.ScreenUpdating = True
Dim count As Integer
Dim X As Integer
For count = 1 To 20
If activecell.Value "" Then
activecell.Offset(1, 0).Select
[code].....
what changes should i make in this code to insert rows only when ther are now blank rows. So first time i run, blank rows are already there, and when i update some data at the bottom and re-run it inserts blank rows again.
I do an analysis that contains 100 or more rows with 1 of 2 row labels in column A; "existing" or "retrofit." There may be numerous successive rows labeled "existing" in a given place where there is no retrofit. Rows labeled "existing" contain existing equipment details such as area, equip description, operating cost. Rows labeled "retrofit" contain recommended efficient replacements with details such as area operating cost and savings. I have to display total cost and savings. Right now I use the awful method, F1+F3+F4+F5... for existing and F2+F6... for retrofit. This is a terrible method, time consuming, prone to error, etc. Is there a way to total rows with specific labels when the row labels are not consistently alternating? Would like to attach an example spreadsheet but... the permissions say I may not, for some strange reason.
View 9 Replies View RelatedI have data of about 3176 rows,
But after every record one row is blank,
I have to manually delete each blank row.
How to delete it in one Go.
Please Find the attachment....
I have a single column of data and need to convert it into 2 columns, by alternating each row:
1
2
3
4
5
want to convert to:
1
2
3
4
5
6
I've seen a previous post from 2007 where someone asked for a formula to do the reverse of this. 'Domenic' provided a formula =INDEX($A$2:$B$6,INT((ROWS(D$2:D2)-1)/2)+1,MOD(ROWS(D$2:D2)-1,2)+1) which converted
a
1
b
2
c
3
d
4
[code]....
how to reverse this formula?
I have a huge excel file and every row is repeated, e.g.:
john smith 10 23
john smith 10 23
bob jones 11 22
bob jones 11 22
etc..
So I want to delete every second row.
Is there a command to do that?
How to delete every alternate rows in excel.
Eg. I need to delete even rows in my spreadsheet, (row 2, 4, 6 etc..)
AND
How to delete rows that contain both text and number but start with text then number.
Eg. My data as below:
12345hello
hello12345
123423hehehe
kekeek11
Result: what i want
12345hello
123423hehehe
is there any easy way to fill alternate rows of a worksheet with a particular color? I have a worksheet with 175 rows and alternate rows are to be filled with green!
View 4 Replies View RelatedI have a file that contains multiple rows of data. I built a macro that will then hide rows with a $0 balance. When the macro is completed, my spreadsheet is only showing the lines with a $ amount. (The $0 rows are hidden)
What I'd like to do is then format the unhidden rows so that each alternate row is color coded. This will separate the rows visually so I can more easily follow the rows across to view $'s per line.
I've attached a sample spreadsheet (it does contain the macro to hide the $0 rows). How can I then format the remaining rows with alternate shading?
Currently I am using Excel 2007. I want to merge data of alternate row of a particular column in Excel.Also i want to remove merged row. E.g.
Name City Pincode
John Mumbai
John 400009
Carol Delhi
Carol 110001
Carol Pune
Carol 411079
I want output to be ----->
Name City
John Mumbai-400009
Carol Delhi-110001
Carol Pune-411079
macro/formula for the above requirement..?
how I can alternate the background color (fill color) of rows in a spreadsheet. Say I wanted every other row to be gray starting at row 10.
View 6 Replies View Relatedi have attached a copy of an excel file and if you look at the end i am trying to write an IF statement that reads if J = "2-0" then column M = 12-(K) or 12--4 so answer is 16 and then column N = -column M or -16 and then if J = "2-1" then M = 6-(K) or 6--0 = 6 and then N = -M .....
so if J was "2-1" and (K) -4 then the answer given for column M would be 6--4=10 and column N = -10
I need to sum the contents of every fourth cell in row A .... ie sum(A1 + E1 + I1 ... BY1)
Can I do this via the formula bar, or do I need to use a VBA routine?
to be able to select every row, 1-3000, containing a value that will be typed into b2.
In other words, say I type 213 in b2, I need each row that contains 213 to be selected so that I can use those rows in another macro I have running.
I have recorded the following into a macro where the cursor returns from another workbook and wants to select from where it starts (Row 2) and where it ends (could be one row or could be several hundred) as it is to stop where it sees the next break (empty cell). The first set that is recorded happens to have four rows but could be one row up to several hundred. How can I have the cursor land and select the data if it is only one row, 10 rows or many more? There are more rows below the first group so once it selects and copies the data, the cursor should go to the next group and select the group before copying out again i.e once it copies the first four rows, the cursor will go to row 6 (there are two rows between each group) and select from row 6 to the bottom of that section which may be only row six or could be row 58 etc.
Range(Selection,Selection.End(xlDown)).Select
ActiveCell.Rows("1:4").EntireRow.Select
10.000 Rows have full of numbers in Cells.I have a Macro for each row.But I want to use this Macro for all Rows automatically.
View 5 Replies View RelatedI am trying to record / edit a macro in Excel Office 2003 that selects a cell (c6), then goes to the last cell to the right of that range which I am doing fine
Range("c6").Select
Selection.End(xlToRight).Select
What I do now is select from that last cell found in the range down to the last cell in that column and I am getting that to work OK
Range(Selection, Selection.End(xlDown)).Select
I now have a range of data on one column selected as the last column of data in a range. What I am having difficulty finding the solution to is how I can keep this range highlighted and include on the highlighted range the previous column of data as well (column to the left) - which would give me the last column of data (this months infomation so to speak) and the previous columns data as well (last months so to speak) - so I can then progress to copy paste to a selcted area - later I will add a new column of data so the last column and the previous one moves to the right every month so cannot select by specific cell references
I want to reference to a range of tables depending on the value of a separate cell. Problem is that I don't know how to insert this into the range part of the lookup formula.
EG
=vlookup(a12,NAMED RANGE AS PER CELL c9,2,false)
Cell a12 is the lookup reference which is fine.
Named range is set-up and working fine.
Cell c9 is the description of the named range - season_indices_Asda_Cream
I want that to be changeable by he user so they can change the name in cell c9 from a drop down list so that the lookup formula redirects to the alternate named range...
Is there any way that i can copy a row of data, but paste each individual cell that has been copied into every other column, or every 3rd column, or every x number column.
I want to do this as i have 3 column headers repeated across spreadsheet representing each month. and would like to paste into the relevant column i.e budget actual difference budget actual difference budget actual difference.
So I can paste each value under the actual column.
Im wondering if their is a formula to return the results in a Hlookup but adjusted for the cell 1 cell to the right?
For instance if Row 1 Column one contains "Tom Jones" that the forumula knows to return the value in row 2 column 2 instead of row 2 column 1.
I have a row range to sum only alternate cells.
How can i do this job by means of formula.
I have been using a lot of sumproducting lately with multiple conditions to extract data. Lately I have noticed that though it is a good way to extract data there is a lot of calculation time involved in it. The Excel workbooks that i make are in a database like format where there is 1 sheet usually a data dump which has data from one column to the 200th column and rows being filled with data points till the 10000th row. Data headers in the columns are usually like Date(ColumnA), Tenure(ColumnB), Person, Type, etc and then from Column Z onwards there are columns which contain Data in the form of numbers like Number of cases, Number of this and number of that.
Now usually when creating a dashboard of this data for performance management I use the sumpoduct formula to retrieve data. It normally has conditions in it like for some given date ranges, Tenure ranges, People ranges extract x data for me. For Example something like this
=SUMPRODUCT((Sheet2!$A$4:$A$4898>=VALUE($E$3))*(Sheet2!$A$4:$A$4898
I can't remember any formula to do the task. I have a time series with quarterly sales. The dates are in format given below.
01/01/1990 - first quarter of 1990
02/01/1990 - second quarter of 1990
03/01/1990 - Third quarter of 1990
04/01/1990 - fourth quarter of 1990
I need to add the sales of all first quarters , all second quarters..and so on.
Is there any formula that an elegant way or I have to do it manually?
I have tried to apply '= SUM(INDIRECT("A2:A10"))' formula to do the SUM at cell A11. But, if I add two more Rows, then my formula moves down to cell A13 but numbers in Cell A11 and A12 does not get added to the total. How can I avoid that? I have reserached this site extensively and could not find an archived solution.
View 6 Replies View RelatedI have a table of data that is laid out in multiples of two columns. I have attached a simplified example. Essentially all I need to do is count the contents of every second cell when it equals a specific value. If you look at my attached example it will be clearer. how I can do this using formula? (I don't want to use VBA in this instance).
View 7 Replies View RelatedI'm trying to analyse some data, consisting of a table with clients "checking in" at a certain restaurant at a certain time. In another table I have the restaurant data, including information on different discounts they offer on different days and at different times. If a restaurant offers distinct discounts for distinct days of the week (or hours), it will be listed several times. Now, for each check-in I'd like to know, how much money the client safed (all check-ins are within some of the discount hours of the restaurant they checked in at). If there were only one line per restaurant, VLOOKUP would do the task without any problem, however, as there are several rows per restaurant, I don't know how to look up the correct discount according to the date and hour the client checked in. I've attached a data sample.
View 1 Replies View RelatedLike say I have a column which begins with an indeterminate number of blank cells before there is an indeterminate number of cells with numbers or blanks in them. I need to leave the beginning blanks alone, and perform a sort on all of the rows below. How to code up a macro to do this, but I don't know jack about that, so I was wondering if there is some kind of function or conditional sorting I could record as a macro?
View 2 Replies View RelatedI have a very large worksheet with many dates entered. I want to be able to run a macro that prints all the rows that has a date less that 35 days ahead in the future. all the dates are mixed up and not in any order.
Is there a way i can do this?
How do I select all the Columns and Rows that are not being used so that I can hide them. I like the blue background it gives when they're all hidden. I am using Excel 2007 and it's not too bad selecting all the columns but there are just way too many rows.
View 3 Replies View RelatedI am trying to select the active row and the next 21 rows down, so in all 22 rows should be selected after the macro runs.
View 4 Replies View Related