excel如何用宏替换某列中的几个内容

[复制链接]
查看11 | 回复3 | 2012-11-27 15:40:08 | 显示全部楼层 |阅读模式
虽然已经有推荐答案了,但是我也写一个吧(个人觉得我写得好一些,O(∩_∩)O~):Sub C_replace()Dim pc(), pe(), c As Range, i%pc = Array("北京", "上海", "新疆", "江西")pe = Array("beijing", "shanghai", "xinjiang", "")For Each c In Range([H2], Cells([h65536].End(xlUp).Row, 8))
For i = 0 To 3
If c = pe(i) Then c = pc(i)
NextNextEnd Sub...
回复

使用道具 举报

千问 | 2012-11-27 15:40:08 | 显示全部楼层
Sub test()
Application.ScreenUpdating = False
MaxLine = [H65536].End(xlUp).Row
For i = 2 To MaxLine
temp = Application.Cells(i, 8).Value
Sele...
回复

使用道具 举报

千问 | 2012-11-27 15:40:08 | 显示全部楼层
sub ti()for i = 1 to 21if cells(i,8)="beijing" then cells(i,8)="北京"if cells(i,8)="shanghai" then cells(i,8)="上海"if cells(i,8)="xinjiang" then cells(i,8)="新疆"if cells(i,...
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行