简体   繁体   English

Excel-自动将公式单元格替换为其结果

[英]Excel - replace a formula cell with its result automatically

I am trying to make a sheet to add to templates that I give to my students for homework assignments; 我正在尝试制作一张表格,添加到我给学生做作业的模板中; some of them are cheating by sending each other the files and I would like to catch them. 其中一些通过相互发送文件来作弊,我想抓住它们。

I have made a formula cell that populates with the current OS and directory of the file. 我已经创建了一个公式单元格,其中填充了文件的当前操作系统和目录。 What I would like to do is have this become text after evaluation so that if another student opens the file it will not change (but the following cell will, and so on..) Here is the formula: 我想做的是在评估后将其转换为文本,这样,如果另一个学生打开该文件,该文件将不会更改(但以下单元格将保持不变,依此类推。)这是公式:

(Cell A1): =INFO("osversion")&INFO("directory") (单元格A1): =INFO("osversion")&INFO("directory")

(Cell A2 and beyond): =IF(A1=(INFO("osversion")&INFO("directory")),"",IF(LEN(A1)<2," ",INFO("osversion")&INFO("directory"))) (单元格A2及更高版本): =IF(A1=(INFO("osversion")&INFO("directory")),"",IF(LEN(A1)<2," ",INFO("osversion")&INFO("directory")))

Do you know if there is any way to have a formula cell be replaced by its value after execution without using VBA? 您是否知道在不使用VBA的情况下是否有任何方法可以将公式单元格替换为其值? (If I use VBA it asks if you want to enable macros on startup which kind of gives the game away...) (如果我使用VBA,它将询问您是否要在启动时启用宏,从而使游戏消失……)

Thank you in advance for your help! 预先感谢您的帮助!

There is a workaround: Use Track Changes. 有一种解决方法:使用修订。 If you are using Excel 2010, for example: 例如,如果您使用的是Excel 2010:

  1. Go to the Review tab and in the Changes group click Share Workbook . 转到“ Review选项卡,然后在“ Changes组中单击“ Share Workbook
  2. Click the checkbox for Allow changes by more than one user at the same time . 单击“ Allow changes by more than one user at the same time进行Allow changes by more than one user at the same time ”复选框。
  3. In the Review tab, select Track Changes|Highlight Changes . 在“ Review选项卡中,选择“ Track Changes|Highlight Changes
  4. You may wish to select All for the When option and Everyone for the Who option. 您可能希望为“ When选项选择“ All ,为“ Who选项选择“ Everyone Who

You can then choose to highlight changes on screen and/or list changes in a new sheet. 然后,您可以选择突出显示屏幕上的更改和/或在新工作表中列出更改。

If you do that before you make your final changes to the file, you can confirm that nobody has Accepted Changes between the last time you saw the file and the time it is returned to you by checking that your last change is shown correctly. 如果在对文件进行最终更改之前执行此操作,则可以通过检查是否正确显示了上次更改来确认在上次查看文件与将文件退还给您之间,没有人Accepted Changes

That will then let you see all the people who have edited the file since you last edited it, and what changes they have made. 这样一来,您就可以查看自上次编辑文件以来所有编辑过文件的人,以及他们进行了哪些更改。

(EDIT) (编辑)

As @Siddharth Rout pointed out in another answer, one can use technological means to make cheating on assignments more difficult but a sufficiently resourceful student can always find a way to circumvent such measures. 正如@Siddharth Rout在另一个答案中指出的那样,人们可以使用技术手段使作弊更加困难,但有足够谋略的学生总是可以找到一种方法来规避此类措施。

This predicament can be resolved by distinguishing two cases: 可以通过区分以下两种情况来解决这一困境:

(a) learning opportunities where students can choose to learn (do the assignment and get feedback on their approach - not a mark) or not choose to learn, and (a)学习机会,学生可以选择学习(做作业并获得关于他们的方法的反馈-不是成绩)或不选择学习;以及

(b) evaluation processes where one can measure how much they have learned (eg by getting the students together under one roof). (b)评估过程,在该过程中,人们可以衡量所学到的知识(例如,通过将学生聚集在一个屋檐下)。

In case (a) students are not being evaluated and so have no motivation to "cheat". 在(a)情况下,学生没有得到评估,因此没有“作弊”的动机。 In case (b), they are being evaluated but have no opportunity to cheat. 在情况(b)中,他们正在接受评估,但没有机会作弊。

Do you know if there is any way to have a formula cell be replaced by its value after execution without using VBA ? 您是否知道在不使用VBA的情况是否有任何方法可以将公式单元格替换为其值?

The answer to your question is " No, it cannot be done " 您的问题的答案是“ 不,这无法完成


Even if you considered VBA as an option, it's futile as this is a classic example of XY Problem . 即使您将VBA视为一种选择,也没有用,因为这是XY问题的经典示例。

No matter what you do, you cannot stop your students from cheating. 无论您做什么,都无法阻止学生作弊。 Consider these few scenarios. 考虑以下几种情况。

Scenario 1 场景1

Student A has 1.xlsx . 学生A有1.xlsx Student B has 2.xlsx . 学生B有2.xlsx After student A finishes his/her assignment, he/she create a copy of 1.xlsx . 学生A完成作业后,将创建1.xlsx的副本。 Let's call it Copy.xlsx . 我们称它为Copy.xlsx Now Student A gives Copy.xlsx to Student B. Student B opens Copy.xlsx and copies the answers into 2.xlsx . 现在,学生A将Copy.xlsx给学生B。学生B打开Copy.xlsx并将答案复制到2.xlsx Once finished, Student B deletes Copy.xlsx and gives you 2.xlsx . 完成后,学生B删除Copy.xlsx并给您2.xlsx So now tell me how will you know Student B cheated? 所以,现在告诉我,您如何知道学生B被骗了?

Scenario 2 方案2

Student B calls Student A on mobile. 学生B通过移动电话呼叫学生A。 They both have their copies opened. 他们俩都打开了副本。 Student A gives all the answers on the phone. 学生A在电话中提供所有答案。 How will you know Student B cheated? 你怎么知道学生乙被骗了?

Scenario 3 场景3

Student A and Student B open files in two laptops next to each other and finish the assignment. 学生A和学生B在彼此相邻的两台笔记本电脑中打开文件并完成作业。 How would you know who cheated whose assignment? 你怎么知道谁欺骗了谁的任务?

Alternative? 另类?

Get all the students under one roof and then get them fill it up in front of you. 将所有学生放在一个屋顶下,然后让他们填满在您面前。 There is no other way you can even guess whether someone cheated unless someone is fool enough to mention other students name in his/her template or copied the answers verbatim. 甚至没有其他方法可以猜测某人是否作弊,除非某人愚蠢到在他/她的模板中提到其他学生的名字或逐字复制答案。

You could always put some text in a cell location that only you know about and make the text white. 您总是可以将一些文本放在只有您自己知道的单元格中,并将文本变白。 You could code your text for each student and lock only the contents of that one cell with a password. 您可以为每个学生编写文本代码,并使用密码仅锁定该单元格的内容。

That's what I would do... 那就是我会做的...

You can give each of them a different problem (maybe the same problem with different data). 您可以给他们每个人一个不同的问题(对于不同的数据可能是相同的问题)。 You will detect cheating of any kind by just looking at the results. 您只要看一下结果就可以发现任何一种作弊行为。

Programming or IT is not always the solution, even to programming or IT problems. 编程或IT并非总是解决方案,即使对于编程或IT问题也是如此。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM