Replace Deleted Formula When Cell Cleared
Feb 19, 2014
I'm not sure if this is impossible (surely not) or if I'm just Googling the wrong terms (most likely). I have a sheet that we use to record staff shifts and when they take their lunch breaks. By default most of our employees have a 1 hour lunch and they take it 4 hours after they start. So far so good, I've set up a formula to work out what time their lunch would start and end based on this.
N237: =IF(AND(L237>0,L237<>"NWD"),SUM(L237+(1/6)),0) - Lunch start 4 hours after start time in L237 (NWD = Non working day)
M237: =IF(N237>0,SUM(N237+(1/24)),0) - Lunch ends 1 hour after lunch start time in N237
However, not everybody follows the default - some people take lunch later, or don't take as long due to working shorter hours.
What I'd like to do is allow users of the sheet to overtype the times generated by the formulas when applicable, but if they delete their own custom value for lunch breaks I would like the formulas to re-appear and thereby return lunch times to the default values.
I could do this through VBA with a button to look for blank cells, but I would prefer it to happen automatically. Is this possible and if so what code would I need to make the magic happen?
I should maybe have mentioned that this sheet has space for 250 names and an area for each day of the week, so these formulas would appear in 1,250 different places
View 4 Replies
ADVERTISEMENT
Nov 2, 2009
I need help with a code to detect deletion of a cell's value.
In cell I10, a user can choose one of six items from a data validation list. Right now, I have code in there to pop up a message if the user selects value "X" from cells F6:F10 and G6:G10, but cell I10 does not have value "A", "B" or "C" already selected.
What I want, is if cells F6:F10 and G6:G10 have value "X" in them, and the user deletes values "A", "B" or "C" from I10 or changes it in any way after it has been filled, then to have a message box pop up.
View 7 Replies
View Related
Dec 22, 2009
Here is the scenario:
A B C D
BananasApplesOrangesTotal113=A1+B1+C1
I need to reference the formula in D1 with the cells headers names.
In a perfect world, it would take
=A1+B1+C1:
and produce:
=Bananas+Apples+Oranges
View 9 Replies
View Related
Feb 23, 2008
I am using vlookup to get a cell value from another sheet, but if the cell has "&" or "/" I need to substitue "&" and "/" with "and" so that the cell can be added later to a url.
i am using =VLOOKUP(a1,Sheet2!A1:W17968,6) to get the value of a1 in sheet 2 and return the value of column 6
this will return "Audio Cables & Leads" but i need it to say Audio Cables and Leads
I need the formula to also check and replace "/" with "and" as well so cables/wire will be Cables and wire
View 9 Replies
View Related
Jun 6, 2007
I have a spreadsheet that has a formula placed from cells B21 through to AT21. This formula is present in the sheet 95% of the time, but occassionally the user has to enter his/her own value in one of the cells.
How can I check or the user be reminded that he/she has deleted a formula and replaced it with a user defined value. ie a message box(only as a warning) to be displayed just before the workbook is printed. The user should be able to acknowledge the message displayed and carry on.
View 9 Replies
View Related
Jan 6, 2012
I am looking for the macro which can replace cell value with his first row. e.g. Column D contains the cell value "X" and i want to replace that value with D1. The same i am looking for all field.
View 5 Replies
View Related
Apr 8, 2014
I need a formula in i.e F3 ... that will check cell G3 to see if there is any values in this cell... If yes... I need the values in G3 to be replaced with "1year" if false .. then "".
View 9 Replies
View Related
Apr 20, 2013
I am using following code to effect a change which works fine:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Sheets("Closed Flts").Unprotect "abcd"
Sheets("Faults").Unprotect "abcd"
[Code].....
But when the sheet is unprotected to effect this change the formula in cells ( row I and L) are visible to user and can delete them. Or they can even delete the cell itself or modify formula.
The formule in Row I is
Code:
=IF(A12="","",IF(G12=1,A12,IF(G12=2,A12,IF(G12=3,A12+1,IF(G12=4,A12+5,IF(G12=5,A12+28,"priority?"))))))
And in Row L is
Code:
=IF(A13="","",IF(I13
View 1 Replies
View Related
Sep 15, 2009
In the following formula, I would like to replace STARK with the value in cell D33. I've tried a couple of different things using &s but no luck yet. I think I'm just missing something really simple.
View 10 Replies
View Related
Feb 17, 2008
I am looking for a formula for a cell that will do the following:
from :
robert johnson hot dog
To this
robert+johnson+hot+dog
I would like it only to change the space between the words to a + sign.
View 9 Replies
View Related
Mar 25, 2012
I would like to use the code below such that column "A" contains unit list pricing, Column "B" calculates the discount from the net pricing in Column "C." For example, A1 = 100, B1 = 1- (C1/A1), and C1 by default is equal to A1 but if the user enters in a net rate, say 85 in C1, it retains the 85 in C1 but if then later deleted, the C1 automatically reverts back to =A1. The code below works great for C1 but for the life of me, I cannot figure out how to modify the code and have it work correctly for a range of cells in Column "C" or all of Column "C."
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Address(False, False) = "C1" Then
If IsEmpty(.Value) Then
Application.EnableEvents = False
.Formula = "=A1"
Application.EnableEvents = True
End If
End If
End With
End Sub
View 2 Replies
View Related
Jun 26, 2012
I have a formula in cell J2:
='H:Folder[CI10001G.xlsm]Sheet'!$C$5
I need a macro that will change the part of the formula that is "CI10001G" to the value of cell A2 which would basically be something along the lines of "CI10004D" so the formula would change to the following:
='H:Folder[CI10004D.xlsm]Sheet'!$C$5
And then this formula will then successfully look in the newly directly file path.
View 9 Replies
View Related
Feb 4, 2014
Is there a formula that can find a keyword within a cell then replace it with a formula that will add the adjacent cell value up.
A1=103 B1=104
A2=104 B2=105
A3=105 B3=Out-1p-(1)
A4=110 B4=111
A5=111 B5=112
A6=112 B6=113
A7=113 B7=114
A8=114 B8=Out-3p-(23)
I am looking for a formula that can automatically calc (B3) to 106 (based upon cell A3) if the cell has a value of (*out*).
View 1 Replies
View Related
Apr 10, 2007
when i am doing the coding
may i know if there is a way to replace the cell address $A9 below: ...
View 3 Replies
View Related
Jun 18, 2014
Here is the code I'm working on:
I want this code to replace the value of s with the value of a cell.
sub Macro2()
Dim s As String
s= value of (cell F2)
Range("I8").Select
ActiveCell.FormulaR1C1 = "='[(s).xlsm]Payroll Computation '!R8C11"
End Sub
View 5 Replies
View Related
Apr 9, 2008
I want to set up a sheet macro that will replace the contents of a cell (when a specific number is typed in) with a specific formula.
For instance, when "43" is typed into any cell within specified columns (say columns C and H), it changes to the following formula: =IF(D47="",43,IF(D47<=3030,408,43))(WHERE D47 WOULD REPRESENT THE CELL ADJACENT TO THE CELL WHERE "43" WAS TYPED.)
IE:
If "43" was typed into cell C1, then it would change to the formula: =IF(D1="",43,IF(D1<=3030,408,43))
If "43" was typed into cell C50, then it would change to the formula: =IF(D50="",43,IF(D50<=3030,408,43))
View 12 Replies
View Related
Nov 28, 2007
I have a spreadsheet in excel with scheduling information, each group of data (job) is made up over 2 columns and 6 rows and is in a block (this is so it is easy to view and manouvre)
I have a link in another worksheet that extracts information from the cell if a criteria in the group is met!
At the end of each day I need to delete the columns (B and C, which make up that day) in the schedule.
When I do this all the references in the other worksheet are messed up, even though the next day is moved to columns B and C.
I would like the link to the other worksheet to automaticaly recognise the new values in column B and C as the reference.
View 9 Replies
View Related
Jul 11, 2014
I want to delete a cell row in a table when I delete a corresponding worksheet with the same name as the cell.
For example, on the attached, if I delete the worksheet "Shawn" then I want row with "Shawn" deleted from the table on the "Example" tab. If I delete "Becky" worksheet then the row with "Becky" should be deleted from the table on the "Example" tab.
Delete cell when worksheet deleted.xlsx
View 4 Replies
View Related
Apr 24, 2009
I was customizing my rightclick cell menu, for cells in certain columns, to add some links to files and then I would delete them when right clicked in some other column.
By mistake I deleted EVERYTHING from my rightclick menu. If found where the problem was so it wouldn't happen again.
So now I am trying to put back those basic commands in the rightclick menu , but I cannot get those 'icons' that shows up on left of each command. how to get that?
View 2 Replies
View Related
Jun 5, 2007
I've a worksheet with 36 columns to keep track of a football confidence pool,I've a CF in which a W is entered in every other column from B1:AG1 and it highlites the whole column yellow,in column A is all players names,from column B2:AG2 I enter the 32 NFL teams,in row B3:AG3 I enter points from 1-16,in column AI it adds all numbers in yellow per row which gives me a weekly score,in column AJ I've the players name and there year to date points and finally in column AL it ranks the players by highest point total.
I will use this on a weekly bases for 16 weeks,what I need is for column AJ to keep adding the players points once I delete there respective numbers from rows B3:AG3 and add new ones for the following week.
Formula in cell AI3 =sumif($B$1:$AG$1,"W",$B3:AG3) copied down
Formula in cell AJ3 =A3 & " " & AI3 copied down
Formula in cell AL3 =rank(AI3,$AI$3:$AI$8,0) copied down
I also have the following macro an my sheet which allows me to use the formula in column AI3.
Function ConditionalColor(rg As Range, FormatType As String) As Long
'Returns the color index (either font or interior) of the first cell in range rg. If no _
conditional format conditions apply, Then returns the regular color of the cell. _
FormatType Is either "Font" Or "Interior"
Dim cel As Range
Dim tmp As Variant
Dim boo As Boolean
Dim frmla As String, frmlaR1C1 As String, frmlaA1 As String
Dim i As Long
View 11 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
Mar 18, 2009
I am trying to create a macro where it finds a a certain word in a column for example C. What i want it to do is find anything that says FWD_EUR and then replace that cell (e.g C2) with CASH_EUR_FWD and after it has done that it replaces the adjacent cell (e.g. D2) with EUR_FWD. I then want this to do the same with FWD_USD to CASH_USD_FWD and adjacent cell to USD_FWD.
View 2 Replies
View Related
Jul 1, 2014
When I use a reference to populate a cell in anothe worksheet and I use the delete key to remove the entry, a zero shows up in the cell of the worksheet wit the cell reference. For example if I use =AM!A3 and use the delete key to delete the entry in cell A3 of worksheet AM, the worksheet with the reference =AM!A3 shows a zero. Is there some way to prevent the zero from appearing in the cell with the reference?
View 3 Replies
View Related
Sep 11, 2013
I created comments to be shown when drop down list items are selected using the helper cell and workbook change solution from Leith Ross at the thread below.
[URL]....
This works perfectly to show the comments. What I'd now like to do is delete the comment if the content of the cell is deleted.
View 5 Replies
View Related
Dec 5, 2012
I have a cell in my spreadsheet (J3) that I need to never be changed or else other macros in my workbook will not work properly. I decided to try and use data validation since it is easy to change the rule every month and I can stay away from messing with passwords.
My cell value is a date, so I set data validation to have that cell equal only that specific date. If a user tries to overwrite the cell value, the error messages is prompted correctly. The one BIG problem is that I can just press the delete key and delete the contents of the cell. Is there any way of preventing this from happening without having to lock the cell and password protect the sheet?
View 3 Replies
View Related
Apr 15, 2008
I used the code below for Conditional Formatting. This works fine but the VBA-code crashes when I delete more than one selected cell. Is there a simple modification possible to prevent this from happening?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer
If Not Intersect(Target, Range("A1:C250")) Is Nothing Then
Select Case Target
Case 1
icolor = 6
Case 2
icolor = 12
Case 3
icolor = 7
Case 4
icolor = 53
Case 5
icolor = 15
Case 6
icolor = 42
Case Else
'Whatever
End Select
Target.Interior.ColorIndex = icolor
End If
End Sub
View 3 Replies
View Related
Jul 22, 2009
I'm sure this has an easy solution, but I'm having a problem putting it into a working formula. Column I lists checks numbers. Column J contains the amount of the check. Column K contains a "Y" when the check clears the account, otherwise it's left blank until the item clears. Cell O2 is where I want the balance formula.
I want O2 to look at Column K & then sum the amounts from Column J where the corresponding Column K is blank. If it were just one cell, it's a pretty easy if(k4="Y","", j4), right? But since it's a range of cells, not sure how to tell it to look down the range for all uncleared checks and put the sum in one cell.
View 2 Replies
View Related
Nov 3, 2009
I have a worksheet that I have removed a good number of hyperlinks, using the remove hyperlink function. My problem is that every so often, the hyperlinks are back on the sheet, without seeing any wording for the hyperlink.
Some place, a long time ago, I saw that there was something in the program that either stopped this from happening or turned the function off or a way of restoring removed hyperlinks. Today, I can't find it.
If I run my cursor over the spreadsheet, even over blank cells, I will get the evil finger of fate (so to speak) indicating that there is a hyperlink in that cell and yes, there is. If I click the cell, the site will be activated.
How do I keep these removed hyperlinks from returning.
I've also noticed that at anytime, while working on the sheet, everything flickers just as if the links are being re-populated. After a second or two the flickering stops and yes, the links are back.
View 12 Replies
View Related
Jan 1, 2014
I have a macro that runs with worksheet_change if I delete a cell. It does not run if I just clear contents. Is it possible to have the macro run when I clear contents of a cell?
View 4 Replies
View Related
Aug 18, 2006
I have a rather large userform with numerous textboxes and comboboxes. Data entered into the text and combo boxes is written to the next empty row of a sheet. As the data to be entered into the next row may not "all" vary from the last I would like to have the data I have last selected or entered remain in the textbox or comboboxes for the next. I attach an example for a better explaination.
View 6 Replies
View Related