本文转自:http://stackoverflow.com/questions/11953214/excel-how-to-lock-cell-without-using-macros-if-possible

You can prevent a user entering new data using only Data Validation

EDIT: use formula in list

Thanks to Head of Catering's comment, it is worth remembering that you can use formulas with Data Validation / List.

See his answer to another thread to see this in action: http://stackoverflow.com/a/11902463/138938

Original post

Walkthrough for Excel 2007:

  • Ribbon > Data > Data Validation
  • Authorize : Personnalized (or similar, my Excel is not in English sorry)
  • Enter this formula in the field:
    • =IF(A1="",FALSE,TRUE)

Thus, you cannot enter a value in the cell if A1 is still empty

Got it to work, but you can only actually set the value when it works out to a dropdown

I used Name Manager to set the name test to the value =IF(Sheet1!$A$1=1,"",Sheet1!$E$1:$E$5)

this means that if A1 is 1, I get nothing, and if A1 is anything else I get E1:E5

Then I set the data validation to List, with source to =test you can only set the value when test returns a list

When I do this, when A1 is 1, I get an empty list in my validation dropdown, and I can't change the value. If A1 is not 1, I get my list of E1:E5, and I can change the value

[转]Excel - How to lock cell without using macros if possible的更多相关文章

  1. Java的poi技术遍历Excel时进行空Cell,空row,判断

    /** * 导入信息 */ @Override public List<Object> add(HttpServletRequest request) { // TODO Auto-gen ...

  2. Java poi读取,写入Excel,处理row和cell可能为空的情况

    首先需要导入包 import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.poifs.filesystem.NP ...

  3. 用 Excel 测试“绘制两点间连线”的算法

    最近在研究和制作数字示波器,其中涉及一个小算法:需要将 ADC 采样的数值在 TFT LCD 屏幕上面显示并且用“线”连接起来. ADC 按照时序对输入电压采样后,记录的是一个个的数值,如果显示的时候 ...

  4. Openxml入门---Openxm读取Excel数据

    Openxml读取Excel数据: 有些问题,如果当Cell 里面是 日期和浮点型的话,对应的Cell.DataType==Null,对应的时间会转换为一个浮点型,对于这块可以通过DateTime.F ...

  5. SoapUI Pro Project Solution Collection-DataSource(jdbc,excel)

    here give a solution for excel file change the excel configuration these: Set Excel file path in cur ...

  6. Ruby操作Excel的方法与技巧大全

    测试工作中,批量的数据通常会放到excel表格中,测试输出的数据写回表格中,这样输入输出易于管理,同时清晰明了 使用ruby来操作excel文件首先需要在脚本里包含以下语句 require'win32 ...

  7. 使用POI来实现对Excel的读写操作

    事实上我感觉直接贴代码就好了.代码里面差点儿做到每一行一个凝视.应该看起来会比較简单 代码托管在github上:https://github.com/chsj1/ExcelUtils package ...

  8. 写20万数据到Excel只需9秒

    on my god,写20万数据到Excel只需9秒   还是菜鸟时,在某个.Net项目中,用户需要从业务系统导出Report,而数据量通常都在上万条以上,最初采用的方式就是在服务器端用NPOI生成E ...

  9. 通过Excel认识POI

    1.POI是什么 Apache POI - the Java API for Microsoft Documents,顾名思义,Apache的三方包,用来操作微软office文档的,多数时候用来操作e ...

随机推荐

  1. javascript中怎样验证密码是否含有特殊符号、数字、大小写字母,长度是否大于6小于12

    今天在温习了一下以前学过的知识,一般常用验证密码是通过正则表达式或是通过ASCII 一.用AscII码来验证

  2. 【学习整理】NOIP涉及的数论 [updating]

    扩展欧几里得 求二元一次不定式方程 的一组解. int exgcd(int a,int b,int &x,int &y) { int t; ;y=;return a;} t=exgcd ...

  3. 由SimpleAyncTaskExecutor到ListenableFutureTask

    Spring AsyncExecutor观后感 导语 本来想看下spring关于Async&Sync TaskExecutor的主要内容,看着看着发现ListenableTaskExecuto ...

  4. Java synchronized关键字用法(清晰易懂)

    本篇随笔主要介绍 java 中 synchronized 关键字常用法,主要有以下四个方面: 1.实例方法同步 2.静态方法同步 3.实例方法中同步块 4.静态方法中同步块 我觉得在学习synchro ...

  5. 【翻译】配置RSVP-signaled LSP

    源地址: https://www.juniper.net/techpubs/software/junos-security/junos-security10.2/junos-security-swco ...

  6. emberjs初学记要

    code { margin: 0; padding: 0; white-space: pre; border: none; background: transparent; } code, pre t ...

  7. bootstrap第一天,响应式布局,栅格系统运用

    <!DOCTYPE html><html lang="zh-CN"> <head> <meta charset="utf-8&q ...

  8. Sql server 2008 R2 配置管理工具服务显示远程过程调用失败:0x800706be

    Sql server 2008 R2 配置管理工具服务显示远程过程调用失败:0x800706be   今天在其他电脑配置 SQl server 2008 R2,安装完成后,发现打开配置管理工具服务 : ...

  9. 【读书笔记】iOS-NSDictionary与NSArray的比较

    有时候为什么不用数组存储然后在数组里查询数值呢?字典(也称为散列表或关联数组)使用的是键查询的优化存储方式.它可以立即找出要查询的数据,而不需要遍历整个数组进行查找.对于频繁的查询和大型的数据集来说, ...

  10. oc 字符串

    #import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepool { ...