Formatting New Rows Added Automatically
Dec 10, 2009
I am working on a spreadhseet with multiple tables present on the sheet. Each table has various formatting, merged cells, formulas, and defined lists. I need to have the table add a new row below the last including cell formatting, formulas, defined lists, so I can just keep going through and do data entry. The code adds a row at the end so I don't run into the table below the present one, by monitoring how far away it is from the "Type" cell tag in column A. The code below is a compilation from viewing other threads, but it just does a copy and paste, including the data that was input so I'm looking at a duplicate row. How can I get ito to clear values in the new row? I can't seem to get it to paste xlPasteFormat and xlPasteFormulas
Is the new row in fact being added below the last? I think it's up one after the macro had run through.
Private Sub Worksheet_Change(ByVal Target As Range)
r = Target.Row
c = Target.Column
If c <> 1 Then Exit Sub
Application.EnableEvents = False
NextLineValue = Cells(r + 3, c)
If NextLineValue = "Type" Then
ActiveCell.EntireRow.Insert
ActiveCell.Offset(1, 0).EntireRow.Copy
ActiveCell.Offset(0, 0).EntireRow.PasteSpecial xlPasteAll
Application.CutCopyMode = False
End If
Application.EnableEvents = True
End Sub
View 5 Replies
ADVERTISEMENT
Jun 30, 2014
I'm using a workbook that has one sheet that pulls data from all the others, displaying a series of rows that summarizes data from each worksheet, each of which is full of data. Its a worksheet that a lot of people use so its kind of tedious to use as of now, because whenever you add a new worksheet of data you have to manually create a row and then manually change all the worksheet references. Is there a way to make rows automatically add and update when a new worksheet is added? I know it would probably have involve some sort of Macro or VBA.
View 1 Replies
View Related
Mar 5, 2013
I have a worksheet used for a car game. Each row is designated to show one particular car that can be used in the game, so let's say that there are 40 cars taking up 40 rows.
Column A shows the car type and model; column B shows the engine that the cars has represented by a number (the higher the number the better the engine is); and so it continues, Column C shows the transmission; column D the brakes etc.
Underneath the 40 rows (lets say from row 45 to 65) I then have a table with spare-parts that can be used to replace the cars existing parts. This Parts-table is also arranged with engines in column B, transmissions in column C, brakes in column D etc...
This point of this layout is that it should be easy to compare each type of part in the spare-parts table with the corresponding type of part already used in any of the cars as everything is perfectly lined up by the columns.
About the spare-parts table: because the inventory in the spare-parts table often are added to or subtracted from, as parts are won in races or being put on the cars, I have created a macro to sort the parts in each column so as to put the best parts at the top of the table and the bad ones towards the bottom - so far so good.
The problem is this - as I add new cars, the table of spare-parts is pushed down worksheet and that means that the macro no longer will reference the right rows. So the question is this, how do I automatically update the macro to adjust for rows being added above it? I am not really interested in redesigning the worksheet.
View 2 Replies
View Related
Jun 27, 2013
We have created a macro that basically looks for rows that contain an "H" and hides the row if it does.
Users can add new rows throughtout the year to this spreadsheet. and based on certain criteria, an H or U will be placed in a hidden column which the macro looks at and hides any row it finds an H.
The user has to click on the button that has the macro assigned to it once they have finished working on the spreadsheet.
The problem we're finding is that for users who insert/delete rows, once they click the button it takes up to 15 seconds to run through macro (which is ok). However, users who haven't added or deleted any rows and who click the button, they have to wait upto 5 minutes (which isn't ok) for the macro ro run.
We can't figure out why the macro takes longer to run when no changes have been made?
View 8 Replies
View Related
Aug 19, 2006
I have attached a copy of the chart and data. My chart starts on the bottom. I had to take out a lot of data but beneath the data shown is much more data..
I want my chart to automatically update when new data is added. Here are the issues. I have several lines of headers and below that my data. Then below my data I have other data that I don't want displayed in the chart (its not shown here because of size limitation of attachmnet).
The new row will be added each time right below the header, right above the
most recent data given. So a row will be added above row 8!
View 9 Replies
View Related
Mar 3, 2013
i am trying to build a spread sheet showing materials in a stores tools, materials,and usage ect. i have put all the formulas in for example cell c =sum(b2-a2) to get a remaining stock left after usage but what i need to know is a way to add more new stock onto the sheet because every time i go to add on new stock it just resets itself is their anyway of doing it so that when you add new stock to cell a for example it automatically adds on to the total in cell c??
View 1 Replies
View Related
Mar 13, 2013
Is there a way to automatically create list of the Tab names, and have it automatically update when new tabs are added?
View 2 Replies
View Related
Jun 7, 2006
[please refer to attached sample data]
The formula in K3 is
"=J15/10"
This formula calculates the average mailing return rate of all the mailings added together. J15 is currently white text to hide it from the end user.
Everytime I add a new row of data I need the formula to update itself automatically. So for example, the next time I add a row of data the above formula has to change to
"=J15/11"
Or if I were to add three rows of data the formula would have been
"=J15/13"
View 9 Replies
View Related
Jun 20, 2014
I need VBA code to automatically send an email notification when data is added to worksheet. I am not very familiar with writing code and have been using other code from other posts. Ideally I would like it to send an email notification with the added information attached, in this case it would be Row # and Columns A thru O.
View 1 Replies
View Related
Jun 19, 2008
Is there a way to make a chart adjust automatically when you add to the source data? I'm trying to use a named range in order to power a chart (something like chart_data=offset(a1,,, counta(a:a),counta(1:1)); the range is working fine). When I put "chart_data" into the source field for the chart, it seems to work fine; it picks up the right range... But when I later add more data, the chart source data field seems to have converted my named range into a hard-coded range, absolute range. So the dynamical named range updates, but the chart doesn't and I don't see the new data. Am I doing something wrong that I need to tweak? Does what I'm trying to do just not work? Is there another way to make the chart pick up the new data without adjusting the range?
View 3 Replies
View Related
Jun 4, 2008
I am running the below code to basically apply a defined list to a cell containing the string "WORKDAMNIT". This list is used as validation. I am running into a HUGE problem where once I apply the validation on about 17,000 cells and try to save the spreadsheet I get an error saying that "Excel could not save all the data and formatting you recently added to...". Thus, the IF loop basically does a save of records everytime I hit about 1000 records. I can even see the file being saved. However, whenever I close the spreadsheet it asks me to SAVE!! If I try to save it I get the same error and if I dont NOTHING gets saved.
Sub Valid()
Dim listCount As Long 'counter
Dim cellCount As Long 'cell Counter for save function
Dim foundCell As Range 'found cell in sheet Find
Dim foundList As Range 'found cell in sheet list
Dim fwb As Workbook 'workbook value
Dim fsheet1 As String 'find sheet
Dim fsheet2 As String 'list sheet
Dim strMatchCol As Integer 'address value of column number
Dim col As String 'actual value of column string
Dim strFind As String 'The string we are searching for (eg. "blah blah")
Set fwb = ActiveWorkbook
fsheet1 = "Data"
View 3 Replies
View Related
Mar 16, 2014
I am trying to get VBA code in Excel to copy formula in specific cells to copy the cell below when an entry is added to a database.
View 3 Replies
View Related
Oct 23, 2006
How do I apply a formula to every cell in a given column?
I'd like my workbook to store this formula:
=c<current_row> + d<current_row>
in every cell of column P as a default.
This means that even if I do "insert row", I wouldn't have to copy this formula into the new cell.
View 6 Replies
View Related
Jan 4, 2007
I've created a simple budget sheet outlining various group expenses eg: Fixed, Flexible, Variable, and their totals sums.
How can I add all totals while still allowing for a new row to be inserted in any group?
eg:..............Row E
1........Fixed Expense group
2..................$20.00
3..................$40.00
4..................$40.00
5....Total sum $100.00
6.......Flexible Expenses group
7...................$10.00
8...................$20.00
9...................$20.00
10..................$10.00
11..................$50.00
12...Total sum $110.00
13......Variable expenses group
14..................$10.00
15..................$10.00
16..................$10.00
17..................$20.00
18..................$10.00
19....Total sum $60.00
20--------------------
21..Grand Total $270.00
View 4 Replies
View Related
Jul 24, 2009
I have a worksheet on which users will enter data one row at a time, in columns A-K. When the user starts to enter data in a new row #, that is, when they make any column in the next, unused row have non-blank value, I'd like the sheet to update the borders of the row for columns A-K. I want the Range from A1 to K# to have full borders, so that the whole data set is outlined and easier to read.
For a bonus, I'd like the formulas from the previous H, I, and J cells copied down into H#, I#, and J#, adjusted appropriately for their reference changes.
Normally, I would work around the edges of such a VB problem by recording the actions manually and then modifying that code as I learned more. But I'm not sure if what I've done is the right way to start that process. I think that if I use the CurrentRegion property, and the Worksheet_Change event, I'll be well on my way.
View 2 Replies
View Related
May 18, 2012
I have a workbook where on one sheet various peoples information is listed and based on their organization the information is then linked to one of a few different worksheets for costs. On the cost worksheets, when a new person is added to the original worksheet, their information populates the next row. At the end of the cost columns I have a the total cost of each person added together. What I need to do is have these totals continue to move down the worksheet as new people are added. Is there a way to do this in excel using VBA or another function?
View 1 Replies
View Related
Jan 5, 2007
I have a sheet (Sheet 3) that is pre-populated from another sheet (Sheet 1), and the user is allowed to update the numbers (for forecasting).
I have a column ( Total Hours) that I use to total the new numbers in the row.
If the user inserts a row, the Total Hours formula does not follow. This is the Total Hours formula that I am using SUM Formula
(=IF(SUM($G30:$AP30)=0,"",SUM($G30:$AP30))
How do I (Can I) get the formula to cascade into the new row.
View 8 Replies
View Related
Oct 28, 2009
I have a sheet titled PartNumbers....which contains in numerical order just 1 column of random 1, 2, or 3 character numerical part numbers. nothing special. and not necessarily in 1 by 1 order. like 45,46,47,48,49, it will skip number more like 45, 49, 50, 55. I have another sheet titled FinalReport.....that takes the raw data i have from the PartNumbers sheet and outputs the data onto a nice pretty looking designed sheet.
on 1 column of FinalReport I have =PartNumber!C2, C3, C4 and so on for the total number of parts i have to fill in the FinalReport sheet for each cell. The Question is, on PartNumbers when I want to add a part, say my sheet goes number 45 then 49 and i want 46... What I do is right click row number and select Insert, that adds a new row for my new part number. Now that move doesn't correspond to FinalReport now, it just removes the row i inserted. How do I get everything to flow to FinalReport?
View 5 Replies
View Related
Feb 12, 2014
So I'm trying to create a macro that will simplify dealing with a file we receive at work pretty often. I've enclosed a spreadsheet that shows a very basic example of the files we receive. What I need to happen is this: On the rows that have only the Company # in column A and Total $ in column D (ie. rows 5 and 6), I need the Total $ amount moved up one row and then for the row it was previously in to be deleted (at that point that row should only have the Company $ and no other data in it so it's basically useless). The problem I'm having is that if any rows are added to the file (for instance if an row was added between rows four and five) it would throw off my macro.
View 3 Replies
View Related
Apr 16, 2008
I'm looking for: a cell (in column C) that sums Column C from C6 to the row above said cell. (A Total) So if new rows were added, these values would be included in the sum.
What I'm currently working with is a simple Sum formula, but this sum does not include rows added after the predefined sum range.
View 9 Replies
View Related
Jun 26, 2006
i'm trying to get data added in one sheet of a workbook to automatically be entered into another sheet. such as a monthly, Quarterly and Annual balance sheet.
View 3 Replies
View Related
Apr 4, 2008
I'm using a template that has formulas using a $ sign to attempt to stop the ranges they refer to changing. The problem is, when I use the template (which involes Access importing some data and adding columns to the sheet the formula refers to in the process) the rows referred to in the formula change in line with the number of rows of data that have been imported. Only the row numbers change not the column headings. So for example:
=( SUMPRODUCT(((Workings!$H$3:$H$1000=Explanation!B9)+(Workings!$E$3:$E$1000="Buy")*(Workings!$J$3:$J$1000))))-998
becomes
=(SUMPRODUCT(((Workings!$H$511:$H$1508=Explanation!B10)+(Workings!$E$511:$E$1508="Buy")*(Workings!$J$511:$J$1508))))-998
View 3 Replies
View Related
Feb 27, 2009
[Excel 2003] I have 2 spreadsheets: one to summarize data from a 2nd detail spreadsheet. I'm analyzing work order information for a service operation.
I'm using dynamic name ranges, as follows, for the detail:
WO_Num =OFFSET('WO Tracking Log'!$A6,0,0,COUNT('WO Tracking Log'!$A:$A),1)
Other detail data is defined as these examples show:
GM_X =OFFSET(WO_Num,0,8)
OpenDate =OFFSET(WO_Num,0,1)
All detail data begins in Row 6 in the detail spreadsheet.
In the Summary spreadsheet, it appears to make a difference where my calcs are located in order for my COUNTIF's to work correctly. As long as I keep my summary calc (to total the number of work orders in the detail) in Row 2 of the Summary, it works fine...but if EITHER I move my calc down a row OR if my detail drops down a row because a row was added above (where I have just header info), my summary totals change?!?! I don't understand.
Here are two examples of the calcs I'm using in the summary:
=COUNTIF(WO_Num,">0")
=COUNTIF(GM_X,"X")
Can someone tell me what is going on? What I'm doing wrong?
View 8 Replies
View Related
Jan 3, 2010
The number of rows you are pasting and then you can select that same number of existing rows and use "insert". This is what I'm trying to achieve:
(before paste)
A
B
C
(after pasting unknown number of rows)
1
2
...
n
A
B
C
Is there really no built-in way to do this?
View 6 Replies
View Related
Apr 5, 2007
When doing vlookups, I frequently encounter an issue where one column isn't formatted the same and the vlookup won't work.
As an example I am trying to do a vlookup from a sql report downloaded to excel and the formatting on the column isn't right. If I type over the data, the vlookup works.
Is there a way to automatically clear the formatting so the vlookup will work.
View 9 Replies
View Related
Feb 7, 2007
This is my first post on this forum and I hope I'll find here all the help needed! This is VERY important for me. My boss is expecting me to finish this week. I am not really an expert in Excell but I have to do some pretty complicated things. At least they are complicated for me. J
OK ... here we go! ....
View 9 Replies
View Related
Jan 7, 2014
I have found that periodically Excel is automatically reformatting everything in large workbooks to Date Format. Initially I save these workbooks with General, Number, Currency, Text, and Date formatting within the cells. Upon opening at a later time, everything is converted to Date Format.
View 3 Replies
View Related
Nov 29, 2013
How to set a column up to show it as the time of day but unless I enter PM after I put the time in the column it always comes up as AM.
Is there some way to just enter 9:09 in column d and or f and have it show up as pm? When I enter 8:10 in column b it automatically adds the AM to it but if I do the same in the column for the night and I do not type in pm it will automatically enter it as am.
I have attached the workbook and did delete the macro - which was just to clear all of my entries but when I click to open it again I am still getting the message about the macro.
In the workbook when I enter the time in column B I can just type in 7:14 and it will automatically add the AM to it. However, when I get to column D or F if I just type in 9:09 or whatever time it is in the evening it will automatically add AM to it unless I type 9:09 pm.
Is there some way to set it up so that I can just enter the time and it will automatically enter pm for everything in that column?
2013 sugar logs.xls
View 9 Replies
View Related
Sep 10, 2013
I have figure A1 column which total amount accounting at cells A31. I need figure 360 as a benchmark calculation perfectly been done. In this calculation 360 well off inside cells A18 although actual number is 363. If we use Conditional Formatting when had enough total in cells the achieve 360, cells colour will be transformed to red. What formula which need I used to change no matter cells on A1 to A30 if sufficient study 360 automatically cells changing colour to red
View 5 Replies
View Related
Apr 6, 2008
I'm building a Excel 2003 workbook that needs more than 3 conditional formats. I've tried the code given in the FAQ: Get Around Excels 3 Criteria Limit in Conditional Formatting but this only works on cells being modified directly. I've also tried the code in the post: VBA Conditional Formatting - Refresh when data changes but neither does the job I need.
I'm using a Format Control to present the user with a list of choices. When the control changes the target cell I want to apply a conditional format to that cell. This image shows the form. When the Format Control selection (in B2) is changed I want to apply conditional formating to the target cell (A2).
There will be up to 10 choices and therefore conditions.
View 9 Replies
View Related