Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 2782|回复: 1

[已解决]求助个vba

[复制链接]
发表于 2015-11-29 14:48 | 显示全部楼层 |阅读模式
        a        b       c        d        e        f         g         h        i        j
1     458             14      658    8       012     369     4       7       25
2
从c1到j1,如果哪格跟a1没有相同的数字就把哪格的数据清空,(例f1跟a1就沒有相同数子,所以f1格数据清空掉)
最佳答案
2015-11-29 15:07
for each rg in range("c1:j1")
k=false
for n= 1 to len(range("a1"))
if instr(rg,mid(range("a1"),n,1)>0 then k=true
next n
if k=false then rg.clear
next rg
excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
发表于 2015-11-29 15:07 | 显示全部楼层    本楼为最佳答案   
for each rg in range("c1:j1")
k=false
for n= 1 to len(range("a1"))
if instr(rg,mid(range("a1"),n,1)>0 then k=true
next n
if k=false then rg.clear
next rg
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-5-7 13:21 , Processed in 0.240263 second(s), 8 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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