ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 效率神器,一键搞定繁琐工作
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
让更多数据处理,一键完成 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
查看: 3874|回复: 3

[求助] 求助:如何禁止在同一列中输入相同的数据

[复制链接]

TA的精华主题

TA的得分主题

发表于 2008-7-21 19:21 | 显示全部楼层 |阅读模式
<p>我用的方法是:数据--有效性--自定义--公式:=countif(a:a,a1)=1</p><p>这样设置好之后,不可以输入相同的数据.但是我按CTRL+D可以复制上面的数据,并且Ctrl+V也可以复制相同的数据在那一列,并且不会出错.为什么????</p><p>有什么更好的公式可以保证不能输入相同的数据吗??????</p><p></p>
[此贴子已经被作者于2008-7-21 19:49:38编辑过]

TA的精华主题

TA的得分主题

发表于 2008-7-21 21:23 | 显示全部楼层
建议用条件格式,出现重复,单元格格式变化提醒

TA的精华主题

TA的得分主题

发表于 2008-7-22 17:18 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2008-7-23 00:43 | 显示全部楼层
<p>可以利用辅助列进行判断,最终结果会显示在C列。</p><p><table cellspacing="0" cellpadding="0" width="713" border="0" style="WIDTH: 535pt; BORDER-COLLAPSE: collapse;"><colgroup><col width="26" style="WIDTH: 20pt; mso-width-source: userset; mso-width-alt: 950;"></col><col></col><col></col><col></col><col width="52" style="WIDTH: 39pt; mso-width-source: userset; mso-width-alt: 1901;"></col><col></col><col></col><col></col><col width="379" style="WIDTH: 284pt; mso-width-source: userset; mso-width-alt: 13860;"></col><col></col><col></col><col></col><col width="256" style="WIDTH: 192pt; mso-width-source: userset; mso-width-alt: 9362;"></col><col></col><col></col><col></col></colgroup><tbody><tr height="17" style="HEIGHT: 12.75pt;"><td class="xl24" width="26" height="17" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 20pt; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: silver;"><font face="Arial" size="2">&nbsp;</font></td><td class="xl25" width="52" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 39pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: silver;"><font face="Arial" size="2"><strong>&nbsp;&nbsp;&nbsp;&nbsp; A</strong></font></td><td class="xl25" width="379" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 284pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: silver;"><font face="Arial" size="2"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; B</strong></font></td><td class="xl25" width="256" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; WIDTH: 192pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: silver;"><font face="Arial" size="2"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; C</strong></font></td></tr><tr height="17" style="HEIGHT: 12.75pt;"><td class="xl25" height="17" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: silver;"><font face="Arial" size="2"><strong>1</strong></font></td><td class="xl26" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent;"><font face="Arial" size="2"><strong>&nbsp;输入行</strong></font></td><td class="xl26" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent;"><font face="Arial" size="2"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 判断行</strong></font></td><td class="xl26" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent;"><font face="Arial" size="2"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 显示行</strong></font></td></tr><tr height="17" style="HEIGHT: 12.75pt;"><td class="xl25" height="17" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: silver;"><strong><font face="Arial" size="2">2</font></strong></td><td class="xl27" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent;"><font face="Arial" size="2">&nbsp;</font></td><td class="xl27" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent;"><font face="Arial" size="2">=IF(COUNTIF(A:A,A3)=1,"A",IF(COUNTIF(A:A,A3)=0,"B","C"))</font></td><td class="xl27" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent;"><font face="Arial" size="2">=IF(B3="A",A3,IF(B3="B","","重复输入"))</font></td></tr><tr height="17" style="HEIGHT: 12.75pt;"><td class="xl25" height="17" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: silver;"><strong><font face="Arial" size="2">3</font></strong></td><td class="xl28" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent;"><font face="Arial" size="2">1</font></td><td class="xl28" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent;"><font face="Arial" size="2">C</font></td><td class="xl28" xfmla="=IF(C4=&quot;A&quot;,B4,IF(C4=&quot;B&quot;,&quot;&quot;,&quot;重复输入&quot;))" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent;"><font face="Arial" size="2">重复输入</font></td></tr><tr height="17" style="HEIGHT: 12.75pt;"><td class="xl25" height="17" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: silver;"><strong><font face="Arial" size="2">4</font></strong></td><td class="xl28" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent;"><font face="Arial" size="2">2</font></td><td class="xl28" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent;"><font face="Arial" size="2">A</font></td><td class="xl28" xfmla="=IF(C5=&quot;A&quot;,B5,IF(C5=&quot;B&quot;,&quot;&quot;,&quot;重复输入&quot;))" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent;"><font face="Arial" size="2">2</font></td></tr><tr height="17" style="HEIGHT: 12.75pt;"><td class="xl25" height="17" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: silver;"><strong><font face="Arial" size="2">5</font></strong></td><td class="xl28" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent;"><font face="Arial" size="2">1</font></td><td class="xl28" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent;"><font face="Arial" size="2">C</font></td><td class="xl28" xfmla="=IF(C6=&quot;A&quot;,B6,IF(C6=&quot;B&quot;,&quot;&quot;,&quot;重复输入&quot;))" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent;"><font face="Arial" size="2">重复输入</font></td></tr><tr height="17" style="HEIGHT: 12.75pt;"><td class="xl25" height="17" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 0.5pt solid; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: silver;"><strong><font face="Arial" size="2">6</font></strong></td><td class="xl28" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent;"><font face="Arial" size="2">&nbsp;</font></td><td class="xl28" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent;"><font face="Arial" size="2">B</font></td><td class="xl28" xfmla="=IF(C7=&quot;A&quot;,B7,IF(C7=&quot;B&quot;,&quot;&quot;,&quot;重复输入&quot;))" style="BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent;"><font face="Arial" size="2">&nbsp;</font></td></tr></tbody></table></p><p></p><p>第2行显示的为公式,第3~6行显示的是实例</p>
[此贴子已经被作者于2008-7-23 0:45:31编辑过]
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2025-1-12 06:17 , Processed in 0.023116 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表