Retain Formulas In A Few Cells In A One Worksheet So They Are Not Cleared By "clear Contents" Without Using Protect Sheet

Apr 8, 2008

i have a worksheet which is a form which feeds into another worksheet which acts as a database. i have a button which clears the form based on code which is essentially "clear contents".

the problem is i have a few cells where i would like to retain the formulas. i tried to do this with custom in validation but this did not work. i also tried to enter the code directly into the worksheet but this didnt work either (my skills are limited..). i am avoiding using protect sheet bc that in turn will affect many of my other buttons. is there something i am overlooking?

View 9 Replies


ADVERTISEMENT

Toggle "Protect/Unprotect Sheet" In Macro

Nov 27, 2009

Toggle "Protect/Unprotect sheet" in macro
Correct the following macro. It does not work.

View 2 Replies View Related

Protect Cells So That Users Can Only Input Numbers Or The Text "NA"

Jun 15, 2006

I need help with a macro that allows users to put only numbers from a range of 0 to 100 and the only text allowed must be "NA" in an Excel sheet. I know that I can protect the cells from being erased and all but my main issue is that my users are putting all kinds of text values instead of NA or numbers above 100 making my life harder than it is.

View 7 Replies View Related

Macro To Unprotect Sheet Unlock Cells And Protect Worksheet With Same Password

Jan 23, 2012

I have been really trying to get this sorted myself and I can get it to work with one exception. I can't get the sheet to lock with a password. It locks, but if I try to unlock it again, it does so without prompting me to enter a password.

Essentially I am wanting to unprotect two sheets, unlock the cells that were previously locked (so users couldn't enter data in them when the sheet is protected), then reapply the same password to protect the sheet, but now they will be able to enter data in the unlocked range of cells).

The second macro is to reverse the changes made in the first and 're-lock' the unlocked cells) (and again apply the same password to the sheet).

this is the code I have used.

Sub PART_YEAR()

Sheets("2012 Calculator 1 week").Select
ActiveSheet.Unprotect "taado"
Range("D20:D23").Select
Selection.Locked = False
Selection.FormulaHidden = False
Sheets("2012 Calculator 2 week").Select

[Code]...

I am assuming I have superfluous code in there, in addition to my mistake with the reapplication of the password.

View 3 Replies View Related

IF Statement Within A COUNTIF Statement: Cell In Sheet "Summary" Count The Number Of Cells In Column DX Of Sheet "Analyses" That Are Greater Than 0

Apr 22, 2009

I am trying to have a cell in sheet "Summary" count the number of cells in column DX of sheet "Analyses" that are greater than 0, provided that the value in column A of "Analyses" corresponds with the value in B8 of sheet "Summary."

(In "Analyses," there are 106 subjects, each taking up 64 rows. So, columns 1-64 correspond to Subject 1, columns 65-128 correspond to subject 2, etc. In column DX, each subject has 64 values that are either 0 or greater than 0. In "Summary," each subject has one row that summarizes the 64 trials. I want a single cell in the "Summary," sheet to reflect the number of times each subject produces a value greater than 0 in column DX of "Analyses.") I tried using this formula, but it did not work correctly:

=COUNTIF(IF(Analyses!$A$1:$A$10000=Summary!B8,Analyses!$DX$1:$DX$10000,""),">0")

(Summary!B8 = 1, so I am trying to calculate the number of values in DX that are greater than 0 only for subject 1.) When I press enter, this yields a value of 384. This is impossible, given that subject 1 only has 64 possibilities of yielding a value greater than 0. Subject 1 has 2 values in column DX that are greater than 0. I tried making this an array formula by pressing Shift+Ctrl+Enter, and that just gives me a #VALUE! error.

View 5 Replies View Related

Index And Vlookup: Match The "Vendor" On The "PO" Worksheet With The "Vendor" On The "Cube File" Worksheet

Nov 20, 2009

I have attached an example workbook to this message, with the sensitive data removed. I am trying to vlookup the "cube" for the product number, into the PO worksheet, IF the vendor numbers match.

Example:
On row 2 of the "PO" worksheet, part number AC1000110, should have a cube of 2.5 for vendor # 11170. I'm trying to match the "Vendor" on the "PO" worksheet with the "Vendor" on the "Cube File" worksheet, and then return the corresponding "Cube", (in column F of the "Cube File"), in cell U2 of the "PO" sheet. So, what formula needs to be entered in cell U2?

View 2 Replies View Related

Password Protect: Unlock The Worksheet, Autofilter It, Print It, Unfilter It, And Password Protect The Sheet Again?

Jan 12, 2007

I have a sheet that is password protected. I have this code attached to a command button. It will unlock the worksheet, autofilter it, print it, unfilter it, and password protect the sheet again. However it is protecting it without a password. I need to have it protected with the password so that someone will not be able to just go to tools to unprotect the sheet.

Private Sub CommandButton1_Click()
ActiveSheet.Unprotect "rainforest"
Columns("O:O").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=">0", Operator:=xlAnd
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Selection.AutoFilter Field:=1
Selection.AutoFilter
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowSorting:=True, AllowFiltering:=True
End Sub

View 3 Replies View Related

If Function: Add To Make "J3" Not Clear When A Value Is Added To "I3"

Dec 13, 2009

=if(I3>0,"",H3) This statement is in cell "J3". What do I need to add to make "J3" not clear when a value is added to "I3

View 2 Replies View Related

Clear Or Delete Cells Without Formulas

Jul 31, 2007

Im trying to make life easier by setting up some sort of macro function that will clear the contents of all the cells except for the ones that have formulas in them.
I don't want to delete the 1st row as it contains the titles for each column.

View 9 Replies View Related

Linking Cells For Update On One Sheet It Updates My Last "customer Touch" On A Master Sheet

Aug 24, 2009

I am tracking my sales interactions and am trying to link cells so when I update on one sheet it updates my last "customer touch" on a master sheet. Current formula-

On "sheet1" I selected a cell and used this formula... =sheet2!$b$7

The problem is that I want to keep a history of what was in that sheet 2 B7 cell so i insert a row (making B7 move down and become B8) and enter new info into the new b7. if I go back to sheet1 the formula in the selected cell becomes =sheet2!$b$8 I want it to stay to =sheet2!$b$7 no matter what I do... insert rows, delete rows etc...

in short what i am trying to do is have a cell in sheet1 show my last interaction with the customer and keep a history of in sheet2-infiniti.... with the caveat that my last interaction on sheet 2 etc... is listed first (thus the insert row)

View 2 Replies View Related

Macro To Clear Cells With Numbers But Not Cells With Formulas

Jan 22, 2013

Macro to clear cells with numbers but no cells with formulas with in this macro:

Dim i As Long
i = Range("E3")
If i > 0 Then
' Copy range
Range(Cells(6, 10 + i), Cells(500, 17)).Copy
Range(Cells(6, 10), Cells(500, 17)).Select
' Paste special
ActiveSheet.PasteSpecial Format:=2, Link:=1, _
DisplayAsIcon:=False, IconFileName:=False
' Clear i columns on the right
Range(Cells(6, 18 - i), Cells(500, 17)).ClearContents
End If
End Sub

The range is where the cells with numbers need to be cleared but not the ones with formulas.

View 2 Replies View Related

Protecting Formulas In Cells From Clear Contents Command

Sep 19, 2007

I have a worksheet from which I regularly clear all contents by selecting all the rows and selecting 'Clear Contents' from the right button menu. However, I now have added a formula in Col Y that I want to protect. I know I could select all columns up thru X, but that would clear the R1 headers, so I want to avoid doing that. I can always work around, but I'm curious, is there a way to clear only values and thus protect the formulas when using the Clear Contents command?

View 9 Replies View Related

VBA Macro: Clear All Constant Cells In Range That Don't Have Formulas

Jun 22, 2009

is there a way to do this in VBA? I've also read: - Dave Hawley's recommendation of using: Sheet1.UsedRange.SpecialCells(xlCellTypeConstants).ClearContents

from another thread (which is excellent!)

- SHG's recommendation of using a named range, for example:

Range("Inputs").ClearContents

Given my limited knowledge of VBA, how would I now combine the two to write a VBA sub-routine that clears a named range entitled "Entry" on a sheet entitled "Data"? Would the following be the correct syntax: Worksheets("Data").Range("Entry").SpecialCells(xlCellTypeConstants).ClearContents

View 6 Replies View Related

Clear Cells That Have Numeric Data. Keeping Text And Formulas?

Apr 14, 2009

I have a series of worksheets that are formatted for data imported from various scripts.

What I want to do is parse through each worksheet and cell, when the cell has numeric data, I want to clear the cell.

I do not want to clear the cells on the following conditions:
Cell has Text
Cell has Formula
Cell has date, month or time

View 9 Replies View Related

2 Worksheet "Change" Proceedure On One Sheet?

Apr 16, 2009

How can I have 2 worksheet proccedures on the same sheet? Is it possible? How to make it happen.

View 4 Replies View Related

Enhancing Conditional Formatting: Write "NO DATA", "HIGH", "GOOD", "MODERATE", "POOR", "BAD" Depending On The Value

Jul 6, 2006

I would like to write a function that enhances conditional formatting capabilities in this way: suppose that cell(4,5) contains a number that can be 0 to 5
in the adiacent cell(4,6) i want to put a function that:

1) write "NO DATA", "HIGH", "GOOD", "MODERATE", "POOR", "BAD" depending on that value
2)Choose color font depending on value
3)Choose color background depending on value

I wrote this piece of

Public Function StatusResponse(AdiacentCell As Range) As String
Dim thisStatus As String
Dim ThisFontColor As Integer
Dim ThisbkColor As Integer
Select Case AdiacentCell.Cells(1, 1)
Case Is = 0
ThisbkColor = 2
ThisFontColor = 1
StatusResponse = "NO DATA"............

View 2 Replies View Related

"Index/Match" Formulas That Return "#N/A"

Jan 12, 2010

I have some "Index/Match" formulas that return "#N/A" (which is correct) - is there a way to have it return "0" if that's where it leads?

=INDEX('[CTS - 2010.xlsm]2010 CTS'!$D$14:$ZZ$5012,MATCH($L$4,'[CTS - 2010.xlsm]2010 CTS'!$D$14:$D$5012,0),MATCH("Prod. Cost",'[CTS - 2010.xlsm]2010 CTS'!$D$3:$ZZ$3,0))

View 2 Replies View Related

Retain Formulas When Deleting

Dec 17, 2006

how do you store formulas so that they stay in the cells when all info is deleted? so i can use the same spreadsheet every week but all i have to do is select all and delete. if i do it now i lose al my formuals.

View 3 Replies View Related

Access An Userform For Multiple Users With "protect And Share Option"

Apr 27, 2009

Is it possible to use the userform when it is protected and shared.
I am able to access when it is protected. but unable to access when that protected worksheet is shared.runtime error message " unprotect method sheet class failed" appears it is shared and used.I have already raised this [b]issue in the forum.I understood from the answers that it is not possible.

" My requirement is multiple users should use the form and they should not have the access to edit the entires made by them"

Please give me a solution.

" Being a moderator myself i should only be able to edit or modify the entries made by the users."

Note:
I dont want to create multiple excel sheets for multiple users.i want to use a single excel sheet (Shared and protected)

Also provide me an alterante solutions if any

View 10 Replies View Related

Formula To Omit "vs": Count All The Cells With Data In Sheet 1 Column

Mar 7, 2009

im trying to count all the cells with data in sheet 1 column g but it must omit any cells that have "vs" in it. all cells have scores in like 1-1 2-2 2-1 etc but a few have vs in them and i dont want them counted

View 5 Replies View Related

"Pull Up" Columns To Clear Empty Space Below Titles

Mar 18, 2009

I have a spreadsheet as attached where there are titles in row 3, but I want to go along each row and pull up all the data below to the immediate row below the title. This is different in each column but you will see what I mean. I do want this to be VBA and the real spreadsheet has many columns so it needs to cycle along I guess until Row 3 is empty?

View 2 Replies View Related

Call Tracker - VBA Coding: Input Screen To Auto Clear The Fields Once The " Save " Button

Oct 24, 2009

1) We need the Input screen to auto clear the fields once the " Save " button has been pressed and data transfered to the appropriate tracking sheet

2) We want to ensure that if any of the Red cells are empty the " Save " button will give an error ( one complication If the "Transfer Type" highlighted in Blue has an entry " either STD/ISD/ESP " then " Call Purpose " needs to be mandatory

3) somehow the information on the "Comment " field is not getting captured

4) If possible we want a warning indicator if two rows in a tracking sheet ( example London ) are the same based on Coloums B to I ( except C )

5) Is there any possibility to give a pop calender in the " scheduled date " section of Input screen (Row 33)

View 3 Replies View Related

Pasting Cells To Another Sheet If Another Cell = "yes"

Aug 14, 2008

I have started to actually write a few macros for myself and am doing ok ish. this one has stumped me. I would like all open sheets to be considered. if any cell on row 12 on any sheet is changed to "yes", i would like to have from the sheet it was changed on, the following cells copied (some update at intervals, so i would like them copied so they show what is in the cell at that time and then not change with the update)

the sheet name pasted into A144 of sheet 5

the cell from row 6 that is on the same column as the "yes" pasted into B144 of sheet 5

the cell from row 9 that is on the same column as the "yes" pasted into C144 of sheet 5

the cell from row 10 that is on the same column as the "yes" pasted into D144 of sheet 5

if another cell on any sheet is then changed to "yes", i want it to do the same as above, but paste it in row 145, then 146, etc so i end up with a log of those cells when a cell on row 12 = yes

View 12 Replies View Related

"IF/THEN" Logic Formulas And Getting "Not Enough Resources"

Apr 15, 2008

I have a spread sheet with 4 columns and 90,000 rows utilizing 4 "IF/THEN" logic formulas. I am getting a "not enough resources" message in Excel even though I have a top end laptop with all the ram and the biggest HD available.

View 3 Replies View Related

Clear All Worksheet Cells

Oct 10, 2007

Gotta question about destroying the contense of a worksheet. If for instance I got a macro which uses a different source everytime I run it, and this macro gives a result in a result worksheet. How can I possibly delete the contense of the result worksheet automatically before the execution starts? What I mean is: without selecting all the cells and pressing delete or either using a for loop to go through all the worksheet cells. Is there any function which clears the contense of a worksheet? (without deleting the worksheet itself)

View 2 Replies View Related

Clear All Cells On Another Worksheet

Feb 22, 2008

I have the following code in a Excel 2003 spreadsheet with hope that I can clear contents of unlocked cells in one excel file from the code stored in another Excel file.

Sub CLEARSJCCOUNT()
'
' CLEARSJCCOUNT Macro
' Macro recorded 02/21/2008 by Steve Keene
'

Windows("copyAUTOCOUNTSHT.xls").Activate

I get the Subscript Out of Range error window when it hits the first line of code.

I've reviewed this via searching for other posts, but none seem to solve the problem directly.

View 3 Replies View Related

When Protect A Worksheet Then Only UNLOCKED Select CELLS

Oct 5, 2006

Ok I've spent over 2 hours reading MANY peoples issues with this "BUG". Back in 2003 was the earliest... no one has an answer that works.

When you protect a worksheet and only have UNLOCKED CELLS selected...somehow through loading and unloading the file... you can select locked cells....
I can not find a pattern but many people have had this issue all with no concrete answers.

Just by loading and saving, exit and loading and saving, exit and loading.... i can now select locked cells that I previously couldn't. (I can't do anything as it's still protected...) It's a pain because it wrecks my tab flow.

View 9 Replies View Related

Protect Worksheet But Allow Selection Of Locked Cells

Mar 7, 2008

I am fairly new to Macros and such so please bare with me. I work with workbooks that have 30-50 worksheets in them. They are fairly complex and we send them out to our agents to use and need them protected so they cant change anything. I found how I can protect all the worksheets with one macro. There is one more part that I would like to add to this macro that I cant seem to find an answer for on these forums (Yes I have spent the better part of the day looking).

When you manually go to protect a page. It asks you to type in your password for the first time and below that there are a bunch of boxes that can be checked or unchecked. I need the first box "Select locked cells" to be unchecked. It is checked by default. Is there something I can add to my macro to uncheck this box?

This is the topic I used to create my Protect/Unprotect macro.
Macros to Protect/Unprotect Worksheets and Workbooks

View 9 Replies View Related

Replace All Defined Range Names In The Sheet That Start With "Street" To "Road"

Jun 14, 2008

I want to replace all defined range names in the sheet that start with "Street" to "Road"

For example I have 50 defined names in the sheet as such "Street-01", "Street-02"... all through "Street-50"

I want to change them all in vba to Road-01", "Road-02" etc.

View 12 Replies View Related

Excel 2003 :: How To Protect Worksheet (Unlocking Certain Cells)

Feb 24, 2014

I have a sheet witch has a number of tick boxes and depending on the response a number of hidden rows may open to allow further info to be recorded, how do I protect the sheet in excel 2003 as unlocking certain cells & protecting the sheet will not work.

View 1 Replies View Related







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