您的位置首页百科知识

EXCEL内容匹配、标记宏程序

EXCEL内容匹配、标记宏程序

的有关信息介绍如下:

EXCEL内容匹配、标记宏程序

在使用Excel处理数据时,有时需要识别、标记单元格中的内容,如何快速实现呢?

打开要是用的Excel文件

右击sheet页签名称,点击“查看代码”

在打开的界面中拷贝如著敏下代码:

Option Explicit

Sub websitename()

Dim i As Integer

Dim j As Integer

Dim irow As Integer

'计算总行数

irow = 宏程序付排排栗何1.Range("a65536").End(xlUp).Row

For i = 1 To 1000

If Sheets("宏程序1").Cells(i, 4).Value Like "*.zol.*" Then

Sheets("宏程序1").Cells(i, 4).Value = "zol"

End If

If Sheets("宏程序1").Cells(i, 4).Value Like "*.pconline.*" Then

Sheets("宏程序1").Cells(i, 4).Value = "太平洋"

End If

Next

End Sub

点击,运行。

从结果来看已经完成了内容匹配与替换

分享完毕,欢迎小伙伴随时交流。