Adding Rows And Calculation To Macro

Nov 3, 2008

I am extending rows on a salary schedule. As you can see below, the rows include: Bargaining Unit (GP) Schedule(2A) Range(5) Step (A) Hourly (S) and the hourly wage(11.52)

GP,2A,5,A,H,11.52
GP,2A,5,B,H,11.82
GP,2A,5,C,H,12.17
GP,2A,5,D,H,12.5
GP,2A,5,E,H,12.88
GP,2A,5,F,H,13.22
GP,2A,5,G,H,13.61
GP,2A,5,J,H,14.18
GP,2A,5,K,H,14.71
GP,2A,5,L,H,15.26
GP,2A,5,M,H,15.83

The Steps currently go from A thru M but I need to add N thru Z and after step M there is a 3.75% increase for each step.

You can see that this is a csv file (comma delimited). All of the other info needs to autofill and only the new steps (N-Z) will change and the wage for each of the new steps. The last row is 2 decimal points.

View 8 Replies


ADVERTISEMENT

Adding Multiple Rows With A Macro

Feb 23, 2010

I´ve made a simple macro in order to make easier to add new rows in a table, by filling the cells with the new data.

The problem is that according to one of the fields, I´d like that macro to add multiple rows, with exactly the same information but numbering all these rows on this specific field from 1to the number I filled on the respective cell.

For example, I have beyond another fields that I´ve already filled, the field "Parcel" and "Total of Parcels". I filled parcel with number 1 and total of parcels with 5. Then I´d like the macro to add 5 rows with the "total of parcels" cells containing 5 on every row and the field parcel filled with number 1, 2, 3, 4 and 5, for each row created.

View 14 Replies View Related

Macro For Inserting Rows After Every Nth Row And Adding Text To Inserted Row?

May 26, 2014

I have the macro to insert rows every nth row, but need to be able to insert text into that nth row.

I have a list of addresses and every 10 addresses i need to insert a 'seed' which will be have the same details everytime. This is what i have so far...

Sub InsertRowsMod10()
Dim r As Long
r = 10
Do Until Len(Cells(r, 1)) = 0
Rows(r).Insert Shift:=xlDown
r = r + 10
Loop
End Sub

View 2 Replies View Related

Macro Code Hangs/Freezes Adding Rows

Sep 15, 2006

I've managed to use some code I found to add a new row below the selected row, and duplicate all the forumlas of the source row. It worked fine dozens of times yesterday, but today it's decided not to work. It gets as far as creating the new row(s), but then just hangs & excel crashes before duplicating the formulas. I've even tried reverting to an earlier version, which also worked fine, but this crashes also!

Sub Add_New_Row()
' Unlock Worksheet
Worksheets("Sheet1").Unprotect Password:="*****"
Dim x As Long
ActiveCell.EntireRow.Select 'So you do not have to preselect entire row
If vRows = 0 Then
vRows = Application.InputBox(prompt:= _
"How many rows do you want to add?", Title:="Add Rows", _
Default:=1, Type:=1) 'Default for 1 row, type 1 is number
If vRows = False Then Exit Sub
End If
'if you just want to add cells and not entire rows
'then delete ".EntireRow" in the following line
Dim sht As Worksheet, shts() As String, i As Integer
Redim shts(1 To Worksheets.Application. ActiveWorkbook. _
Windows(1).SelectedSheets.Count)..................................

View 7 Replies View Related

Excel 2007 :: Adding And Deleting Rows With Hide Row Macro CheckBox?

Mar 18, 2014

I currently have the following Macro for one of my many checkboxes in 2007 Excel:

[Code] .....

It works perfectly until additional rows are added/deleted before the indicated rows in the code (It changes the number sequence in the workbook). The number sequence stays the same in the code which means I am now hiding rows either before (delete rows) or after (insert rows) the intended rows I want to be hidden. Is there a way to change the above code to remain with the assigned rows regardless of the adding/deleting of rows before it?

View 1 Replies View Related

Business Day Calculation For All Rows

Aug 18, 2013

I have the following formula in a cell

=NETWORKDAYS(A2,B2)-(MOD(A2,1)>=MOD(B2,1))

its works off of cells A2 for the start date and cell B2 for the end date and works perfect

I want to use this in code to automatically count business days for all rows. I have tried the following

Dim ressfp,a4,a5
a4 = Worksheets("Master").Range("O" & b).Value 'target comp date
a5 = Worksheets("Master").Range("P" & b).Value 'actual comp date
ressfp =NETWORKDAYS(a4,a5)-(MOD(a4,1)>=MOD(a5,1))

I get an error on the word MOD saying compile error syntax error but cant work out why

i have tried replacing the networkdays formula with the following

=SUM(INT((WEEKDAY(A2-{2,3,4,5,6})+INT(B2)-INT(A2))/7))-(MOD(A2,1)>MOD(B2,1))

but this gives the error that the curly brackets are invalid characters.

View 2 Replies View Related

Rows(":").Select: Calculation Within The Rows Collection

May 12, 2009

I want to use a calculation within the Rows collection, but I get a type mismatch error. I realize it boils down to syntax, but I don't know what I don't know.

1. In place of, say, Rows("2:37").Select...I want to use Rows("2:x-2").Select where x-2 is a simple subtraction calculation. I also want to use two variables. I'd hope to be able to infer what to do from above, but just in case:

2. Rows("z:x-2").Select

View 4 Replies View Related

If Calculation To Copy Rows Based On Hard Coded Cells?

Jan 31, 2014

I want to copy all rows from my input sheet that have a date less than the date in cell B3 of the output spread sheet and are contained in the stock table (range A7:B17) Sedol in column B Is a unique identifier. I started to do this but am lost.

View 6 Replies View Related

Percentage Calculation Using VBA Macro

Jun 11, 2013

In the Excel sheet i have 2 tabs

1st tab name :Percentage
2nd tab name :Defects.

Need VBA Code for the below scenario :

In the Defects sheet it should perform the autofilter by selecting the Criteria as Severity as Critical and Status as Closed and finally it should take the count of visible cells and it should populate value in the sheet1 (Percentage sheet) in the Critical defects closed field .

Again it should perform the autofilter by selecting the criteria as severity as Critical and status should (New,open ,reopen,retest ,pending closure)and finallu it should take the count of visible cells and it should populate value in the percentage sheet in the Unresolved defects field.

Now percentage calculation should be performed between the Critical Defects closed and Unresolved Defects.

Here is the formula= Critical defects closedUnresolved Defects * 100.

How to perform this Scenario through VBA Macros.

Please find the attached sheet : sample.xls

View 1 Replies View Related

Calculation/ Macro Speed

Sep 24, 2008

I am having a big problem with recalculating cells after running a macro. The macro runs at a great speed, but once the calculation is switched back to automatic, the cells are not calculating fast enough. I waited for 4 minutes and it still had not moved past 0%. The worksheet has approximately 9000 rows out to IG columns. 85% of the cells contain an if-then formula.

View 9 Replies View Related

Calculation Delay Using Macro

Dec 3, 2009

Is there a way to delay the result of a cell formula by three seconds or so? For example, I need to delay the result value of cell B12 for 3 seconds.

View 9 Replies View Related

Adding 2 Rows After Every One Row

Jan 29, 2009

I need some help fomulating a VSB code which would add two rows after every one row.

View 7 Replies View Related

Adding Rows With VBA

Apr 18, 2008

We have workook with several worksheets (tabs). The main page has several headings (category), including "Doors and Ceilings", "Walls" etc. There are currently three rows under each heading. When I go to a category (tab) there is a list of issues in column b. I can go to column A of each issue and if I place an "a" that issue will be copied to the main page under that category. The problem is that i only have 3 rows and I need a row added each time an issue is transferred to the cell before it.

Is there some VBA I can use to detect the precence of data anbd add a row?

View 9 Replies View Related

VBA Macro For Time Calculation / Conversion?

May 6, 2014

I am struggling with the calculation of time in excel and cannot find a reliable solution for it using formulas. The reason is, excel does not display negative time values, unless one formats the results as text. This is no good, as I need to add up those results and that's something excel cannot do with values formatted as text.

Therefore I am aiming to do just that by using a macro. The values in columns I & J should simply be converted and pasted into columns U and V respectively (see attachment). For example 200 minutes should appear as 03:20 [hh:mm]. Accordingly, -200 minutes = -03:20 [hh:mm]

View 2 Replies View Related

Calculation Using Macro ( MS Excel 2007 )

Jan 6, 2008

I want to do simple calculation using Macro in MS Excel 2007..

All the data is in Sheet1 ( Which is 13a ), the calculation is in Sheet2 ( Which is work ) and the result of the calculation will come out in Sheet3 ( Which is result )..

Here is my coding..

View 12 Replies View Related

Stop Sheet Calculation During A Macro.

Aug 20, 2009

Example: I have Sheet 2 set to autocalculate on activate using vb. So when you click on that tab "Sheet 2" it will autocalculate.

My Question is, I have another macro that is copying information between Sheet 1 and Sheet 2. And I don't want calculation to occur during the macro but since it has to select Sheet 2 it performs the autocalculate. Do I have any options to prevent the calculation from occuring when I run my copy paste macro? I only want it to autocalculate when the user selects sheet 2

View 4 Replies View Related

Disable Calculation While Macro Runs

Mar 7, 2008

I have a Worksheet_Calculate Macro running in my workbook. I'd like to disable it temporarily when running another macro because its causing excel to run sluggishly.

View 3 Replies View Related

Adding Two Rows After Every Existing Row

Aug 7, 2009

Is there any way to automatically add two new rows after every existing row containing data?

For example

1 A B C
2 D E F
3 G H I

turn into

1 A B C
(empty row)
(empty row)
2 D E F
(empty row)
(empty row)
3 G H I

View 9 Replies View Related

Adding Rows With Data?

Mar 14, 2013

I have got a spread sheet (Attached) that works out the rankings of youth football teams so that they can be given fixtures against teams of the same ability. I want to use the same system for another age group which has nearly 100 teams in it but I can't get it to work for over 50 teams.

With my basic Excel knowledge I have worked out how to add extra columns with the correct formula, but I can't work out how to add rows with the correct formula to the table that is in cells A12 -C12 down.

Ideally I would also like this table to show the team with the highest ranking in position 1 & in descending order from there - but I would be more than happy just to add the extra rows for now.

View 5 Replies View Related

Adding Two Rows Together If They Have The Same Value In Column A

Oct 7, 2008

I've got an excel sheet which has names in column A followed by 5 numerical values in columns B-F. I'd like to get a macro that will compare the values in Column A and if they match, add the B values, the C values, the D values, the E values, and the F values and delete one row - effectively combining the row. What's the best way to go about this? Also the sheet is already in ascending alphabetical order by Column A, so the rows that need adding will be next to each other. So I guess compare each A value with the one below it and if they match add the rows, but how?

View 5 Replies View Related

Adding Conditional Rows

Jul 10, 2006

I want to be able to have rows/cells generated with a certain text
based on the answer given by a user.

For example, My question in a cell could be "how many groups have you made?".
Now to this if the user answers "3" then I would want three cells below to
ask "what is the name of your first group", "what is the name of your second
group" and so on.

View 11 Replies View Related

Updating By Adding New Rows

Mar 1, 2008

i have rows of data in an accounting worksheet (payments in/out) which needs constant updating by adding new rows. within the row a formula exists in column D such as =SUM(E11:J11) and the next row is =SUM(E12:J12). if i select row 12, right click and select insert, a new blank row 12 appears but without formula in column D. is it possible to insert row with retained formula? i would prefer to add a row from a blank row below current row and have new row appear with above rows formula but this is not vital.

View 12 Replies View Related

Adding Rows Automatically Using VBA

Jan 3, 2014

I have a spreadsheet where I will input details for "incidents" under different headings on one row per entry (I will have a separate tab for each "incident", and each row will relate to each customer affected by this incident)

For every row that is completed I have a "Summary", which is just a section of the same worksheet, that will list all the basic details of the above entries in a format that will be printed and passed to a different department.

As I will be unable to determine whether a particular incident will have 5 entries or 50, I need a way to add a new row to my "Summary" section if and when a row is completed.

I have a formula to populate the data in the "Summary" section automatically, so all I need now is for it to add new rows as and when they are needed, copying the formulas from the original row, so each new "incident" entry is copied each time.

I have created a dummy spreadsheet but I'm not sure how to attach it to this post.

View 5 Replies View Related

Adding Comments To Many Rows In Vba

Feb 15, 2007

Is any way to add automatically comments in VBA

Some combination of "ctrl" with something else.

View 3 Replies View Related

NIGHT Working Hours Macro Calculation

Sep 29, 2012

I would like to write a macro that can return the number of hours worked during the night shift.

In this case, the night shift starts at 21:00pm and ends at 6:am next day.

The column "I2" returns the number of hours worked during the day - formula ((F3-C3+(F3<C3))-(E3-D3+(E3<C3)))*24);
The column "J2" gives the overtime hours taking into account the number of regular hours allowed - IF(OR(I3="",I3<6),"",IF(I3>H3,"",I3-H3));
Cells "C3:F13" allows users to set up (using a data validation list) starting time, lunch in, lunch out, end time ( columns C and D AM; E and F PM);

My question is: How can I calculate night hours in column K, without having conflits with numbers returned in column I (worked hours)? Is it possible to write a macro for this?

Below please see the table:

B
C
D
E
F
G
H
I
J
K

1
Name
Start Time
Lunch In
Lunch Out
End time
BREAK?
Regular hours
Worked Hours
Overtime
Night Shift

[Code] ......

View 1 Replies View Related

Finding Auto-Sort Macro From MIN Calculation

Apr 21, 2014

What I want to do is place a lap time into 2 columns (representing each lap), then excel chooses the lowest number in the two columns on the same row, paste it into another column, and then automatically sort, while keeping the first column static for 1, 2, 3, 4, 5 etc

So what I want is

Column A | Column B | Column C | Column D | Column E
1 | Driver Name | 14.004 | 14.102 | 14.004

I want Column A to remain in tact, never changing, 1-50. I want Column E to hold the fastest lap time calculated from C and D. Then I want excel to automatically sort Column E from lowest to highest, while keeping Column B with a specific driver name in line with their respective lap times. Column A is not a 100% solid requirement, but auto sorting Column E after it's calculated the minimum value of C and D is.

View 11 Replies View Related

Formula For Adding 12.5% Onto Multiple Rows?

Apr 25, 2014

I have a quotation that I am working on that I need to add 12.5% onto each seperate line price.

There are 300 individual lines on the quote all with different pricing but they all need 12.5% adding on so I am hoping there is a simple way to do a bulk sum for all of the rows rather than having to go through each row and creating a sum for each. - ie =(K28*1.125)

View 3 Replies View Related

Form Development - Adding Rows

Dec 16, 2009

I'm creating a spreadsheet to generate a standardized form that I use as a paralegal.

I have 2 things that I don't know how to create....

1 - I want to have y/n questions on the data entry tab. When boxes are clicked Y, it adds a row and language to the form which exists on another tab. I know how to do links and to do if then statements, but I don't know how to make it not take up space when the answer is n. Some of these clauses are pretty long so I don't want to have big blank spaces when the answer is no.

2 - I have certain sections where I need to control the number of rows. I want to have a cell on the data entry tab where I put in the number of rows that I want. The spread sheet would create those rows and I would then enter the data on the data entry tab. On the form tab, the spreadsheet would refer to the cell telling it the number of rows, add those rows, and link them to the data that I entered on the data entry tab.

View 9 Replies View Related

Adding Rows To Sheets With 3D Referencing?

Jun 13, 2013

I have attached a file for reference. I have another file I use that is similar to the one attached, however it has 500+ rows and is still growing. The issue I am having is that in this file I want to make a "Template" worksheet. Basically I need 50ish sheets that are more or less the same. I have a column that describes a item, a items weight, a row with headers for the columns that I want to appear identical on every worksheet. I want the variables to be the count. These will change from sheet to sheet with formulas to than update the totals.

My issue I am having is that I constantly find myself needing to insert new rows for new items. In my real worksheet I have rows grouped together in a logical way so the rows cannot just always be placed in the next available row at the end of a sheet. How I can have sheet 1 be my "template" and the others take their item lists and weights from sheet 1. In the example file I created sheet 1. I than created sheet 2 and selected a cell entered "=" and selected the cell that I want it to have the same info from on sheet one. I fill handled these items down to generate a list. I than held down control and dragged a couple of new sheets. This process works, and is what I am currently doing, but what do I do when I wish to add a new rob between row 4 & 5?

View 2 Replies View Related

Autofiltering Then Adding Value To Filtered Rows?

Jul 25, 2014

I am able to autofilter a sheet to show only rows with a date in Column U but no "x" in Column BC. Now I want to be able to put an "x" in BC in only the filtered rows. The purpose is if someone enters a date in Column U, the macro will show only those rows minus the rows that have already had an "x" added to BC.

For the most part I've gotten this to work using but it will also put an "x" in Column BC, row 3001 on down.

How can I get it to stop at the last row?

Cells.AutoFilter Field:=21, Criteria1:="<>"
Cells.AutoFilter Field:=55, Criteria1:="="
Columns(55).SpecialCells(xlCellTypeVisible).Value = "X"

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved