Excel 2007 :: Autofilling Value To 4 Rows Beneath Last Value In Column?
Jul 24, 2012
I am still new to this, and I pulled this code off of another site.
Background:
- Using Excel VBA, 2007
- I have a sheet that has a name in B6, has 4 blank spaces beneath, and then another name, 4 blank spaces, etc.
- I wrote a code to fill each of these 4 blank spaces with the value at the top of each
- The code works, but it won't fill the 4 spaces at the bottom of the column.
What is needed:
-how I can adjust to code below to fill in the 4 spaces beneath the last value in the column?
Code:
Sub FillBlanks()
Dim rRange1 As Range, rRange2 As Range
Dim iReply As Integer
Is it possible to autofill the blank rows with the row that has a value above them, have it skip the next row with a value, recognize the next blank cells and fill them in with the previously skipped row, and so on down the line? How might I go about doing that?
I'm using this code to find values of "FEP MHS" or "LSD MHS" in column S and if column S containes either of these values it deletes the entire row from the spreadsheet. I need this to work on a spreadsheet that runs on a daily basis and each day it contains a different number of rows. I have used this code to successfully delete most rows that contain these values in Column S but for some reason it does not delete all the rows, typically leaving 6 - 7 rows that contain these values. I'm using Excel 2007 I need code that finds the last row used and deletes the entire row if these values are present.
Dim CelRSLHMHSD As Range, RngRSLHMHSD As Range, iRSLHMHSD As Long Set RngRSLHMHSD = Columns("S").SpecialCells(xlConstants, xlTextValues) For iRSLHMHSD = RngRSLHMHSD.Count To 1 Step -1 If RngRSLHMHSD(iRSLHMHSD).Value = "FEP MHS" _ Or RngRSLHMHSD(iRSLHMHSD).Value = "LSD MHS" _ Then RngRSLHMHSD(iRSLHMHSD).EntireRow.Delete Next iRSLHMHSD
I am trying to reformat the attached doc into one single column, It's a race listing of overseas marathons and I need it to look like this
Event Name Event Date City Country Entry fee Website
in date order, one event after the other in a single column so I can flow it into a word doc ready to be designed. I need to apply in Excel (I am using 2007) to get this doc into the required format?!!
I need to transpose data from Column A to Row 2 and down.
The data in column A is in sections of 19 rows and then a blank cell and another 19 rows of data contimuously, It is a dynamic range and can contain many thousands of Rows.
The data needs to be transposed from Column A to row 2 (row 1 has the head line for each column) so the 19 lines of data is now spread accross 19 columns in row 2 and the next section from column A is spread accross the 19 columns in row 3 and so on.
My data looks similar to the below. (Test Number 0001 starts in A1)
I am using MS Excel 2007 and I am trying to create a macro which will copy column E and paste the data in column E to the bottom of column D. However each week the amount of rows in these column with vary, they will always be the same amount of rows in column E as in column D but there may be 20 rows one week and a 100 rows the next.
The formula I currently have is below but this will only work for a specified number of rows. How I could change this to work for any number of rows?
Code: Sub IPT() ' ' IPT Macro ' ' Range("E1").Select
I have two columns and each record in the spreadsheet fills both cells. I want all rows beneath the data to be hidden except for one, which is for the user to input a new record. When they are done completing the record, 1 row becomes unhidden (which will be for another inputted record). I also need it so that the new row becomes unhidden ONLY when the user inputs values in BOTH columns of the new record. I have already used Data Validation on each individual cell (column a is validated only for numeric entries and column b can only be picked from a drop-down list)
I have some xls files. I need to find the sum of a specific column. the column heading is always TOTAL but the column it resides in changes column to column. so one file may have the text total in column H and others will have the text total in column X. how can i make a macro so it finds the text 'total' and then sums up all the values in that column underneath it and displays it at the very bottom of that column?
I've adjusted a jonmo code to add an item in col B which is not in col A to the bottom of col A. - fab code, thanks jonmo.
But.. i want to:
insert rows beneath those in column A to accommodate the added items and shade those cells in list A once they been added ( so the users now they've been moved )
I've posted the code below ( including my attempts at colour change where it shade the right cell but in the wrong column ) ...
I am having a small problem with microsoft excel 2007.the problem is that: my excel 2007 cannot display tooltip of the column width when I keep and drag left mouse
Show tooltip of the column width as attached file.
I also tried many ways to find settings of advance menu. But cannot.
Autofill column B with sequential values based on whether value in column A changes its value.
I would like to autofill column 'B' with sequential values (i.e. GenoMap1, Genomap2, Genomap3,... GenoMap10, GenoMap11, GenoMap12,... GenoMap104, GenoMap105, etc...), but changing to the sequential GenoMap# only when the value in column A changes.
What I'm trying to do is, create a formula that works like vlookup, except I want to return the value of the cell that is a specified number of cells below the looked-up data in a single column array. So, let's say cell A1 reads "Bacon". In B1, I'd like to put a formula which searches the array for the cell that contains "Bacon" and then returns the value of the cell underneath, let's say the value is "Eggs". Then in C1, I'd like to put another formula which also looks up "Bacon" in the array, then returns the value of the cell that is down two cells from the cell that contains "Bacon", let's say the value is "Milk". And then in D1, a formula that returns the value 3 cells below "Bacon", and so on. All the values here will be text, and not sorted in any specific order. I'll be using Excel 2010.
Please take a look at the attached sheet if it clarifies things.
how can I write a routine to add rows in one Sheet if a condition which involves a different Sheet is met (excel 2007).
In Sheet 1 is a list of ("liquid") names (cells C4:C26) which will need to be expanded should the IF condition be satisfied. In row 27 I have a subtotal (whihc is using data from columns D onwards), and from row 29 down cells are not empty.
The condition I want to verify is in Sheet 4-column I, where it is reported whether a name is classified as "liquid" or "illiquid". If the number of "liquid" names in sheet4-column I is more than the number of names in Sheet1-C4:C26 I would like to add as many rows as the difference between the two lists. Also I would like to make sure that the subtotals that I have in row 27 (and that will be shifted down when new rows are added) will also inlcude the data in the new rows (the subtotal is taking data from columns D onwards).
Should the code need to inlcude the name of the tabs, Sheet 1 is called Summary and Sheet 4 CDS Data.
I need to remove the duplicates under column B for each item under column A and I can't seem to figure out how to do it.
I'm using Excel 2007; I would prefer a VBA solution, as I have to do this on a monthly basis. However, if a formula is the best way to go, then that's just fine. Either way, I'm preparing the data for a pivot table. I am unable to post the actual document in the interest of data protection.
Essentially, I'd like to turn this-
_ A B 1 Paris Bill 2 Paris Bill 3 Paris Mike 4 Paris Derek 5 Paris Derek 6 London Mike 7 London Bill 8 London Mike 9 London Bill 10 London Derek 11 Tokyo Derek 12 Tokyo Derek 13 Tokyo Derek
into this-
_ A B 1 Paris Bill 2 Paris Mike 3 Paris Derek 4 London Mike 5 London Bill 6 London Derek 7 Tokyo Derek
In other words, each city should have only one instance of any name that accompanies it; not all names will accompany each city.
I have a macro that exports a row (or rows) to destination sheet ("Amber") based on criteria in Column K. Once exported I return to the source sheet ("Register") and the row that had the data that I wanted exported has exported the info but the row just sits where it was and appears to only 'clear the contents'. The macro I use is:
Sub Extract_FW_Rows() Set ws = ActiveSheet endrow = ws.Cells(65000, 1).End(xlUp).Row For i = endrow To 1 Step -1
[Code] ......
I set up the macro on Excel 2002 in work as thats what we have....however when I input the same code into my home laptop working Excel 2007, all works perfectly i.e. it cuts the data to destination sheet, goes back to source sheet and the rows have moved up accordingly - I do realise that the action taken is a row removal i.e. I had 1000 rows, macro executes, I now have 999 rows in the source sheet.
What I would like is the same result in 2002 as I get in 2007.
I have files that have thousands of rows in them with company names. The rows contain the company name plus lots of other info. I'd like to be able to create files or sheets with the company name as the file or sheet name with the respective rows contained within it. Make sense?
For example:
Original file or sheet Date Company Info1 Info2 Jul Sams Expense Desk Jan Freds Expense Doughnuts Jun Sams Deposit Return Feb Sams Expense Food Dec Freds Expense TV
Would become:
Sheet or File Sams Date Company Info1 Info2 Jul Sams Expense Desk Jun Sams Deposit Return Feb Sams Expense Food
Sheet or File Freds Date Company Info1 Info2 Jan Freds Expense Doughnuts Dec Freds Expense TV
- 12 unique values in column 6 which represent states within the country. - 7 unique values in column 25 which represent the types of services. - 5 unique values in column 27 which represent the days for doing the services.
I also have a user form that contains CheckBoxes equivalent to all above unique values, and I want the CheckBoxes to do the duty of a filter, whereby after selecting the needed CheckBoxes and clicking on a seperate botton "creating report", I want to show on the spread sheet only the rows of the values being checked and all other rows which don't contain the needed values should be either hidden or deleted.
Excel 2007 holds data of mine in a "format as table" Table. I want to rank the values in one column. Normally I want to do that by ranking the value in the current row against all the remaining values in that column. That is easy.
I got stuck today when I wanted to rank the value of the field in the current row with only a subset of the values in the column. I want to rank the current against the half-dozen or so records that have "A" in an adjacent column, and rank values having "B" in that other column against only the other values a "B" and so forth.
It would be best for all this to be done in formulas in the table rather than a clever use of a pivot or other? But really, I may be open to different approach than I was trying for if I can use successfully!
Is there a way to select completely empty rows in Excel 2007 (Win 7)? I have found directions for highlighting empty cells (f5, Special, Blanks...), but sometimes the cells selected will be in rows with other filled cells in them so that doesn't really do what I need.
I am wanting to find rows that with unique values in the first column, and then take those rows and display them in a more readable format. The section titled input is an example of information that would be pulled from a query into Excel. The Desired Output section is how I would like the info to be displayed. If this is possible without VBA then that is even better.
I have a long (about 180 000 rows) list of part numbers, descriptions, prices and quantities. There are many duplicate part numbers. I need to go through and find the duplicates, add all their quantities into one cell and delete the remaining duplicates. I have used conditional formatting to find the duplicates easier but cannot use the remove duplicates button as it will delete the whole row and I need the quantity information in each row.
Any formula or macro I can set up to search the part number column (F) for duplicates and add the figures in the quantity column (J) and THEN delete the duplicate part number rows?
Maybe I need to put the new combined information in another sheet?
My knowledge of Excel 2007 is minimal, from formatting individual cells, to creating column totals. I've used it for years in my household budgets. I have an attendance form which is about 3 pages long; currently, it's separated at page breaks, with column totals at the bottom of each 'page'. This is easy because the Row #s are infinite, right? Lately there have been regular adjustments, and I believe the project might be less cumbersome if it were spread out on separate sheets, but how to bring the rows of column totals to cumulative totals on the last sheet.
I have several sheets with about 250,000 rows per sheet.
But, even I sort by Column A, there are STILL hundreds or rows that are total blank interspersed down the page . . . I can't autofilter for blanks because there is too much data . .
I am looking for a way of allowing users to edit the existing cells at their will, but simultaneously disabling the option to insert/ delete columns or rows.
By enabling Sheet Protection, I cannot find a way to do it. Can I?
I am on MS Excel 2007 by the way.
I found the way, just unlock all cells in Format Cells, Protection Tab. Then Protect sheet and de-select what you want to disable.
What im needing is something that will duplicate each row based on Column F as shown below... However I also need the duplicate row numbers added to Column G and then the original row deleted... I will try and show you an example of the input/output i would like to achieve: (also the first row can be ignored it will all be headers)
I am trying to develop a compliance report with Excel 2007) based upon a simple pass/fail criteria. The subtotals must be tracked both by Device (column) and by Requirement (row). There are macros (not included in the attached sample) that hides both columns and rows. I successfully found an example which I modified to correctly calculates data for a column when rows are hidden (see GOOD function below). However, I'm totally clueless on how to calculate data by row when columns are hidden (see BAD function below). What I'm trying to figure out is highlighted in red in the attached spreadsheet.
GOOD =SUMPRODUCT(SUBTOTAL(103,OFFSET(B$2:B$5,ROW(B$2:B$5)-MIN(ROW(B$2:B$5)),,1))*(B$2:B$5="Pass"))
BAD (returns 0 and includes a circular reference) =SUMPRODUCT(SUBTOTAL(103,OFFSET($B2:$F2,,COLUMN($B2:$F2)-MIN(COLUMN($B2:$F2)),1))*($B2:$F2="Pass"))
I am using Excel 2007 on Windows 7 Home Premium 64bit.
My Workbook contains 2 Worksheets, both with the same headings in row 1. Sheet2 is initially empty, except for the headings in row 1.
The following is a sample of the data in Sheet1:
[Code] ......
I want to create a Macro to operate as follows:
In the above sample data, rows 2, 4, and 8 are identical, so I want to copy rows 4 and 8 to Sheet2, and delete them from Sheet1.
Similarly:
Rows 3 and 9 are identical, so row 9 should move to Sheet2; Rows 5 and 11 are identical, so row 11 should move to Sheet2. Rows 6, 7, 10, and 12 are all unique, so should be unaffected by the Macro.
New records will be added to Sheet1 periodically, so the Macro will be used each time to move any newly discovered duplicates to Sheet2.
The Macro should make no assumption about how the rows are ordered, and should not change their order.
I have uploaded two Workbooks, such that Workbook1 shows the original data, and Workbook2 shows the result I want to obtain.