Excel: Can we prevent Paste Operation on cells - excel

I have made one worksheet. And there I don't have option for Macro Enabled, as It is going to be distributed among lots of users to fill the information.
Now the question is, there are some data validation fields in worksheet.
If I do copy any data and paste on that field column, it takes any values in that, which is not correct.
Is there any way to prevent paste on cells without Macro code?
Thank you,

If you want to prevent ANY data entry in those cells you can mark them as locked & protect the sheet with a password.
If you want to allow editing those cells but need to validate that only certain data is allowed, you can use Data Validation, Custom & enter a formula.
You won't be able to use custom VBA functions but most standard Excel functions should work.

Related

Can you allow input but disable paste in Excel?

I have an Excel sheet protection set up with intricate conditional formats. I want to allow user input (typing) in a range of cells, but I want to disable copy/pasting in the same range.
2 reasons:
If a user copies from elsewhere and paste into this range, it destroys my conditional formatting. However, an unsophisticated user will never remember to use "paste value only".
If a user is in filtered view and copy and paste in a non-continuous range, the paste will overwrite values in hidden rows without the user even knowing, all they see is that some copied values "disappeared", thus changing values in hidden cells unintentionally.
Is this doable without VBA? because I need this to work with Excel Online with users using the file through SharePoint.

Excel Data Validation - Dont allow Formulas

Is there any way of using Data Validation to stop someone entering a Formula and only allow text?
I don't want somebody using a formula to search very hidden sheets because they will know the names of these sheets.
I know excel is not secure, but I don't want someone to easily read these sheets with just =SHEET!A1
I have tried custom validation
=ISERROR(FIND("=",A1))
but unfortunately I need to allow them to use the = sign
Yes - really simple - create a Custom data validation and use formula: =NOT(ISFORMULA(A1))
No need to over-engineer it with VBA, but of course its easily disabled
No there is not. The closest you could come would be to write a UDF that detects the presence of a formula; enter that UDF on some cell in the active sheet, and reference that cell in the data validation formula.
However, that would not prevent a user from entering a formula in some other cell, and then copy/paste to the validated cell. Data validation only checks when a formula is entered directly. It does not check that pasted data conforms to the rule(s).
Jeeped's suggestion of using worksheet event code would be the way to go. And you could easily protect the entire sheet from that phenomenon.

Data Validation in Excel through Cell

I want to set up Data Validation on a cell / row of cells so that the value in that particular cell cannot be changed but all the rest of the sheet can be edited, thus why I am not using read only.
Currently if I enter the value in the cell, go to Data > Data Validation > Custom & enter ""it achieves this (see screenshots http://imgur.com/a/Ggqar)
What I want to do is set this validation via the cell rather than manually as I plan on writing this field entry when create the excel document through my application.
I have done a lot on searching online and found methods for doing countif etc.. but nothing deal with formula entry for the Custom criteria.
Is anyone able to help?
Thanks for the quick reply DanB but it's not exactly what I am trying to achieve. My end goal is that my application can pass a value into the file (Column A Row 1 [If easier for formatting it can go into each row in column A which is populated but not required]) and the file will be saved locally. The user will then be entering details in Column B, C, D, E, etc... on their local machine, saving it and processing the file again. I want the application to check Row 1 Col A for the value and decide on how to process the remainder of the file based on this value (the reading the values in the file works already). Because each time my application generates a file it will be unique I want to try do the Data Validation using a formula in the cell so that I can write it using my application and not have to manually apply settings to the file. Is it possible to do this kind of validation using only formulas in the cell when populating it?
Fastest solution would be to use a Protected sheet, but only protect that Cell.
To do this, select the entire sheet, and choose Format Cells.
On the Protection tab, remove the check from Locked.
Now, select just the cell you want to protect, and lock it using the same method. At this point, your entire sheet, except for the 1 cell should have Locked unchecked.
Now, on the review tab within Excel, choose protect Sheet, and uncheck the option to "Select Locked Cells".
Then, while the sheet is protected(you can password protect that part of it), that cell can't even be selected, yet the entire rest of the sheet can be.

Excel Copy and Paste while maintaining data validation

When I perform a copy and paste from a blank cell to a cell with data and validation, the validation in the destination cell itself gets deleted.
Is there anyway I could maintain the validation in the destination cell while only pasting the values? (And validating the contents that are pasted)
(Also, and hence the reason why I ask this, I'm not allowed to use the "Paste Special" feature, so a workaround is required)
You have to use VBA (create a macro) to be able to do this.
An example of some code is at this SuperUser link.

Using VBA macro to insert functions VS only using macro

In short, I would either:
Create a macro that runs every time a cell within a certain range is changed, and then writing out the result based on those cells.
-OR-
Create a macro to automatically insert functions that would do the same thing
Things to consider are that this would need to work on multiple tables of varying length without need to manually change anything, and that the results of individual sheets would need to be also displayed in summary on another page.
Which would be more desirable/more efficient/easier to implement?
The subject data entails testing procedures. Sheets contain testing criteria and a column containing PASS/FAIL results. I need to tabulate these. The start of the table and the end of the table are at different rows and are subject to changing.
Without seeing your actual problem I would definitely go for the first option. Having many formulas inserted into cells dynamically I think would be a pain.
Use the Worksheet_Change event and test whether the cell changed is one of your target range, then perform whichever action is required.

Resources