Insert Value On One Sheet Based On Calculated Value

Jun 1, 2007

I run an action log based on one worksheet per project and a front summary sheet. It has 6 columns of which the final is complete Yes / Blank. Currently the summary sheet is hard coded to provide the countblank result in an outstanding column against each project.

My problem is that everytime I add a new action I have to change the hard coded range on the summary sheet.

I know I should be able automate this using VBA and .End xlup so that it always knows howmany rows have been used and can therefore calculate the countblank correctly.

View 9 Replies


ADVERTISEMENT

Insert Calculated Rows

Mar 14, 2007

I need to insert 2 calculated rows in a data table for each state, one is Direct +2%, and Contractor +2%. Ideally, I would like to copy down the field name above. Every record in the table has the same 2 Categories (Direct & Contractor) and 2 calculations need to be applied. There are ~ 50,000 records so copy insert is not an option. Can a macro be applied to do this ?

Current
StateCategoryCount
New YorkDirect150
New YorkContractor75
BostonDirect200
BostonContractor125

Result
StateCategory Count
New YorkDirect 150
New YorkContractor 75
New YorkDirect +2%153
New YorkContractor +2%76.5
BostonDirect 200
BostonContractor 125
BostonDirect +2%204
BostonContractor +2%127.5

View 9 Replies View Related

Insert Text As Comment On Another Sheet Based On Date

Jan 18, 2013

Is it possible to insert text as a comment on another sheet based on a date?

I have Sheet 1, that has 3 columns, Name, Date, Reason

Sheet 2 is a monthly calendar with the dates in E5:AH5 and the names from D6:D10.

What I am trying to do, is when they enter their name, date and reason on sheet 1, I want the reason to to be inserted on sheet 2 as a comment in the cell that matches the date and the name.

View 1 Replies View Related

VBA - Create Calculated Field Based Upon Count Not Sum

May 26, 2012

Can I create a calculated field based upon the count of data items in fields as opposed to sums. My data is confidential so here is a dummy example:

Can I take the count of Cars per individual salesmen and divide by the total count of vehicles? Ultimately, I will need to code this into VBA once I know if it can be done.

Vehicles l salesman
car1 Bob
car2 Kelly
car3 Bob
car4 Bob
car5 Tim
car6 Tim
car7 John

With this result:

Salseman l Percentage of Vehicles
Bob 43%
John 14%
Kelly 14%
Tim 29%

View 3 Replies View Related

Pivot Table Calculated Field Based On 2 Columns?

Jun 9, 2014

I have a Table with 2 columns "Due Date" and "Completed Date". The pivot table from the table gives the count of each column. I want to have a calculated column giving the % complete, ie. "Count of Completed"/"Completed Date"*100. When I attempt to create this formula (using Pivot Table Options > Fields Items and Sets > Calculated field), I get a DivZero error, even though both columns are not zero. How do I create such a calculated column?

View 3 Replies View Related

Formula Automatically Calculated Based On The Numbers I Choose

Oct 17, 2008

Basically...here's what I'm trying to do...

I have 7 numbers. The numbers are going to be grouped in threes.
(Ex. 123,124,125,126,127,134,....)
I want to assign column/range for each number...
1=A2:A100, 2=B2:B100, 3=C2:C100...

So for 123 the formula would be...
sumproduct(--(A2:A100>criteria),--(B2:B100>criteria),--(C2:C100>criteria))

It would be awesome to have the formula automatically calculated based on the numbers I choose.

View 5 Replies View Related

Hide / Unhide Rows Based On Calculated Cell?

Jul 12, 2013

I have a calculated cell (D13) which can either be (All), Grade or Rate.

If D13 = (All), I would like Rows 19:52 to be hidden
If D13 = Grade, Only Rows 19:20 to be hidden
If D13 = Rate, Only Rows 22:52 to be hidden

View 2 Replies View Related

Displaying MIN Date Based On Criteria In Calculated Field Of PowerPivot?

Jan 23, 2014

I have a database with a list of transactions with multiple fields, including:

Customer ID
Store ID
Item ID
Date
Price

I am wanting to add a calculated field that displays the first (or MIN) Date from the date column, looking at all of the orders where the customer ID, store ID, item ID and price are the same.

In the attached file I have shown what I currently have, as well as a solution using a helper column, and formulas I would use if I wasn't using powerpivot.

View 2 Replies View Related

How To Create Calculated Field Based Off Two Avg Fields In Pivot Table

Feb 12, 2014

I have a Pivot table that pulls the Avg of two fields for two months, see example below.

Avg Gross $ Avg Net $
Jan 2014 20 10
Feb 2014 30 20

sample 1.png
See sample attached.

The Avg Gross and Net is shown by going into the values and selecting "Summarized value by -> Average".

On the right side of this Pivot, what I wanted to do is to show a Avg Gross to Net $ in this pivot. So the formula should take "Avg Gross $" - "Avg Net $" = Avg Gross to Net $.

I am having trouble calculting this new field in the pivot table using a calculated field because the Calculated field pulls the variables from the existing field list and there isn't a field called "Avg Gross/Net"....I need to find a way to calculate the Avg Gross to Net into the Pivot table so I can pull a pivot graph out of it.

View 3 Replies View Related

Excel 2010 :: Pivot Table Add Calculated Field Based On Certain Text In Report Filter

May 29, 2014

Any way to create a calculated field in an Excel 2010 pivot table that will find all the Transaction Types (Report Filter) with "transportation" in them and make the field Quantity 0 and leave all other quantities the same? I do not want the quantity of transportation added in twice and may not have the flexibility of adding a column to the raw data.

I used the formula below in a calculated field and it does not match the values using the added column to the data file.

=IF(ISERROR(SEARCH("*transportation*",'Transaction Type')),Quantity, 0)

I am trying to get the sum of Quantity field to equal the AdjQuantity field using a calculated Pivot field and not add a new column to the data.

View 2 Replies View Related

Lookup Sunset Time Based Onrecord Date - Incorrect Time Calculated

Mar 22, 2012

Consider this code:

'light eligibility
Dim facb As String
Dim sunset As Variant
[color=green]' check if facility has lights[color]
facb = WorksheetFunction.VLookup(RID, ds, 10, False) 'find facility code
If WorksheetFunction.VLookup(facb, fac, 6, False) = "Y" Then 'facility has lights
sunset = WorksheetFunction.VLookup(tempws.Range("A9"), sun, 2, False) 'lookup the sunset time based on the record's date

[Code] ......

This code checks the need for lights at a facility.

It first checks to see if the facility even has lights by cross-referencing a value in the record with a facilities database.

If it has lights, it then checks to see if they are needed. If the rental goes past the sunset time, then it needs lights. Sunset is determined by cross-referencing the date value in sheet1! A9, with the sunset database.

If it needs lights, variable lghtson is calculated equal to "sunset"-30 minutes.

As I step through this code:

WorksheetFunction.VLookup(facb, fac, 6, False) = "Y" Facility has lights.
Check to see if lights are needed.
sunset = WorksheetFunction.VLookup(tempws.Range("A9"), sun, 2, False)
sunset=0.879166666666667 which is 9:06PM. This is a proper value from the lookup.
If rental_end.value > sunset Then
rental_end (value from textbox) = "9:30 pm" , sunset=0.879166666666667. This is true, and Excel accepts it as true ...
lghtson = sunset - 0.5
0.379166666666667 = 0.879166666666667 - 0.5 (9:06 AM)

This is not the value I was looking for. I was looking for 8:34PM (0.856944444444444)

View 2 Replies View Related

VBA To Insert An Index/match Forumla On Sheet 1 To Lookup A Value From Sheet 2

Jan 11, 2007

see attached workbook. I want VBA to insert an index/match forumla on sheet 1 to lookup a value from sheet 2. I don't want it to specify a range though. I want VBA to look to see if there is data above and to the left of the cell and if it is true insert the index/match formula. Then it won't matter what row or column I put the headings in.

View 2 Replies View Related

VBA To Insert New Sheet After Current Sheet, Not In Front

May 20, 2006

Why is Excel so back-***wards on this? Is there a VBA solution to having a new sheet inserted after, not before, the current sheet that can be attached to an icon?

View 3 Replies View Related

Sheet Format Changes When Insert Another Sheet

May 20, 2009

I just making a good format for the main sheet of the excel but when I insert another sheet the format change to default (colmun size for exemple).

I want to make the format for all the sheet os the excel.

View 10 Replies View Related

Insert Rows From One Sheet To Another Sheet

Jan 28, 2014

My problem is as follow:I created an Excel file "Schedule" that must be met to describe the various sessions and presentations of a conference.

Some sessions are called "Parallel sessions". These Parallel sessions include several Sub- sessions for which few presentations can be defined and running in parallel.

On Sheet "Day 1", I have described the overall planning with:
a) Parallel Session Day 1 (Level 1)
b) Sub- sessions such as: Scientific Session 1 - PS11, PS12 etc. ... (Level 2)
c) and for each of these sub sessions ... several presentations (Level 3)

As a first step I cannot predict the number and the content of each line presentation (L3) on sheet "Day1".

Accordingly, an Excel spreadsheet is addressed to managers who will feed me information such as PS11 and PS12 sheets.

Once I got the different sheets PS11 , PS12 etc ... I'm looking for a VBA script which could read all the different rows ( under the line of Title in yellow and take the relevant columns - Titles, Speaker Last Name and Abstract Text ) from sheets PS11 and PS12 and insert them under the right "sub-session" in Sheet Day1.

On the other hand if there are several "run" , the script must be able to identify if the row to be inserted already exists ( based on a comparison between the " Title" of sheets PSxx and "Title " of sheet " Day1 . " in this case it re- crashed the line and does not add new one.

I have attached the Excel file with Day1 , PS11 and PS12 sheets.

I didn't find anything that develop a loop on one sheet and insert the result in another sheet.

View 6 Replies View Related

Auto Populate Calendar Days Based On Month / Year And Auto Insert Work Based On Dates / Name

Jul 31, 2013

I am trying to auto generate a calendar based on two drop down menus - Month and Year.

Once the month and year is selected I want to import all work orders onto the calendar based first on the "Labor Name" found in the list of work tab, then assign each work order for that labor name to the respective date on the calendar for the month.

August PM Schedule Demo.xlsx

View 2 Replies View Related

VBA To Insert New Sheet?

May 8, 2014

The code below runs fine except when I insert the sheet_name_to_create line towards the bottom. Something seems to be wrong with the syntax, but I can not figure it out. Basically, I am trying to create one button that will classify and after that insert a new worksheet.

[Code]...

View 5 Replies View Related

Insert Row On Every Sheet

Jul 7, 2009

I have 200 sheets on a workbook if i try selecting all sheets as a group or then even insert a row it takes ages and screen goes white.. Can anyone help me with quicker way with a vba code where by i could insert row on Row 1 & Row 3 on every sheet of workbook.

View 9 Replies View Related

Insert Row From Different Sheet If It Does Not Exist?

Jul 25, 2014

I have a workbook with 2 sheets of data. I'm having trouble coming up with a code that can check if a row from sheet 2 does not exist on sheet 1, and if not, copy that row from sheet 2 and insert it into sheet 1 (preferable on the fist blank row).

It should check 4 specific columns on sheet 2, and if sheet 1 doesn't contain a row with the same data in those same 4 columns than the entire row should be inserted into sheet 1.

For example lets say row 4 of sheet 2 contains the values "Blue" in column D, "Green" in column E, "Yellow" in column H, and "Purple" in column I. If sheet 1 does not contain a row (any row, not just row 4) with those same 4 values in those same columns, then the entire row from sheet 2 should be inserted into the first empty row in sheet 1.

View 9 Replies View Related

Insert Date In Sheet Using VBA

Feb 9, 2013

Code that will change the name sheet1 to today's date using vba.

I need to replace "sheet1" with today's date e.g. 2-8-13

View 4 Replies View Related

Copy Sheet And Insert At End?

Dec 5, 2013

I have the current macro which copies a hidden sheet and places it after the current sheet named "Background". I'd like the macro to instead place it at the end (far right) of all the sheets, regardless of what they are named. How can I do this?

Sub NewSheet()
Sheets("Blank Category Sheet").Visible = True
'Replace "Sheet1" with the name of the sheet to be copied.
ActiveWorkbook.Sheets("Blank Category Sheet").Copy _
after:=ActiveWorkbook.Sheets("Background")
Sheets("Blank Category Sheet").Visible = False
End Sub

View 2 Replies View Related

Insert Sheet Name In A Cell

Jun 5, 2009

try to insert sheet name in a cell but without luck.

there is anyway to do this 'simple' operation?

View 9 Replies View Related

Insert Row On A Table In Protected Sheet

Dec 11, 2013

I am working on an excel table in my worksheet contains formulas and locked cells. lets say table range is from column "a" to "f" and there is formula on cell in columns "c" and "f". I just locked cells in column "c" and "f" to prevent people changing the formula accidentally. but when the sheet is protected i am not able to insert or delete rows as the rows has locked cells in columns "c" and "f".

I tried the below macro to unlock the sheet, insert row and lock the sheet again:

[Code] .....

So by running the macro it asks the password and do the job but the issue is it needs password and i do not want people to know my password. I don't want them able to unlock the workbook and make any undesired changes. I want them to be allowed insert or delete rows and input data in unlocked cell. I want the sheet to be locked all the time and only when people want to insert or delete a row it be unlocked and be locked again after inserting or deleting whit no need to insert password in this case only.

View 1 Replies View Related

Transfer Value To Sheet And Insert Value To Date

May 8, 2014

Solve this issue for transfer value from master sheet ( Daily Report) to corresponding sheet and add value according to its Date. E.g. :

Master Sheet : Daily Report

Manpower : 35

I want to transfer the value of manpower to sheet ( D_manpower) and insert value 35 to according to month & date ( C5 & G5) shown in master sheet ( Daily Report )

Like this all data need to insert according to its corresponding sheet according to month and date

File attached : Report 2014.xlsx‎

View 3 Replies View Related

Insert Values From One Sheet To Another With A Loop

Oct 5, 2008

I need to insert values from a column in one sheet to another sheet with a Loop mentioned here.

(I have attached a sample workbook for your kind reference.)

IN STATEMENT SHEET, I NEED TO INSERT (IN col F) THE VALUES from Col A of NOS sheet.THE INSERTION SHOULD BE LOOPED AS MENTIONED HERE

i.e. First time, it should be 1 to 10
Second time it should be 2 to 10 and 1
Third time it should be 3 to 10 and 1, 2
Fourth time it should be 4 to 10 and 1,2,3
Fifth time it should be 5 to 10 and 1,2,3,4…. And so on, till the last row with a value in ColA.

THE VALUES IN Col A of NOS Sheet MAY BE CHANGED WHENEVER REQUIRED. There it is 1 to 10, but it may be Alphabets or any other words also.
Hence, whatever values in Col A of NOS sheet should be taken for looping.

View 8 Replies View Related

Duplicating Insert Row And Delete Row On Another Sheet

Sep 27, 2009

I have two sheets, they basically contain shifts. They are laid out identically the only thing that changes is the date along row 1. In order not to have to recreate the workers from sheet1 onto sheet2 I use the following

View 2 Replies View Related

Macro To Insert Web Browser On Sheet?

Oct 11, 2012

I am trying to use a macro to insert a webbrowser on a sheet and then link the webbrowser but it keeps giving an error that it doesn't support what I am trying to do.

Code:
Sub Macro1()
Sheets("sheet2").OLEObjects.Add(ClassType:="Shell.Explorer.2", Link:=False, _
DisplayAsIcon:=False, Left:=117.75, Top:=25.5, Width:=256.5, Height:= _

[Code].....

View 4 Replies View Related

Macro - Insert New Sheet If Value Found

Aug 29, 2013

I have a code that copies rows to another sheet if a value in D:D is found. BUT I need to add a "create sheet" IF the value exist.

So if VBA finds the value "TWO" in Column D, then insert a sheet at the end named "Two"

Then the code below will copy all the values of "TWO" over to sheet "TWO"

Dim LR As Long, i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To LR
If Range("D" & i).Value = "9" Then Rows(i).Copy Destination:=Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Offset(1)
Next i

In essence, the VBA should:
Search for "ONE" in D:D, not find anything and move on.
Search for "TWO" in D:D, will find it, Create a New Sheet named TWO, then the above Code to copy all matching rows into sheet TWO.
Search for "THREE" D:D, not find anything and move on....

There will be roughly 12 sheets created on average, so if I create all sheets beforehand.

View 1 Replies View Related

Insert A Comment Without Unprotecting Sheet

Sep 28, 2007

scenario: sheet & work book are protected to users; however need them to sometimes insert a comment to this sheet.

all columns/rows are locked except columns K, R, Y and every 7th column thru CJ (rows are from 4 - 100).

how do I enable a user to insert a comment without unprotecting sheet / WB? note: there's no pattern, it could be any cell within aforementioned columns.

View 9 Replies View Related

Add/Insert Sheet Named Off Cell

Oct 6, 2006

I am trying to get VBA to insert a new sheet and have it be renamed or just named by data that is in a certain cell. My attempt:

sheets.add.name = range("A1")

View 3 Replies View Related







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