五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

實(shí)例41-拆分中文英文數(shù)字,實(shí)例42-兩列交叉合并,實(shí)例43-一列交叉拆分為兩列

2023-03-21 11:43 作者:凌霄百科_Excel辦公程序  | 我要投稿

實(shí)例41-拆分中文英文數(shù)字

Private Sub CommandButton處理_Click()

With Worksheets("處理結(jié)果")

.Columns(2).ClearContents

.Columns(3).ClearContents

.Columns(4).ClearContents

For i = 1 To .Range("A1000000").End(xlUp).Row

If .Cells(i, 1) <> "" Then

.Cells(i, 2) = 提取中文(.Cells(i, 1))

.Cells(i, 3) = 提取英文(.Cells(i, 1))

.Cells(i, 4) = 提取數(shù)字(.Cells(i, 1))

End If

Next i

.Activate

End With

End Sub

Function 提取中文(ByVal extractdata As String) As String

提取中文 = ""

Dim extrattext As String

Dim ei As Long

Dim itemchar As String

Dim extract_array() As String

Dim extract_i

For ei = 1 To Len(extractdata)

itemchar = Mid(extractdata, ei, 1)

If itemchar Like "[一-龥](méi)" Then

extrattext = extrattext & itemchar

End If

Next ei

提取中文 = extrattext

End Function

Function 提取數(shù)字(ByVal extractdata As String) As String

提取數(shù)字 = ""

Dim extrattext As String

Dim ei As Long

Dim itemchar As String

Dim extract_array() As String

Dim extract_i

For ei = 1 To Len(extractdata)

itemchar = Mid(extractdata, ei, 1)

If IsNumeric(itemchar) Then

extrattext = extrattext & itemchar

End If

Next ei

提取數(shù)字 = extrattext

End Function

Function 提取英文(ByVal extractdata As String) As String

提取英文 = ""

Dim extrattext As String

Dim ei As Long

Dim itemchar As String

Dim extract_array() As String

Dim extract_i

For ei = 1 To Len(extractdata)

itemchar = Mid(extractdata, ei, 1)

If itemchar Like "[a-zA-Z]" Then

extrattext = extrattext & itemchar

End If

Next ei

提取英文 = extrattext

End Function

實(shí)例42-兩列交叉合并


Private Sub CommandButton處理_Click()

With ThisWorkbook.Worksheets("操作界面")

If Trim(.Cells(2, "C").Value) = "" Or Trim(.Cells(5, "C").Value) = "" Then

MsgBox "參數(shù)不能為空"

Exit Sub

End If

'定義變量

Dim startrow As Long

startrow = Trim(.Cells(2, "C").Value)

Dim stoprow As Long

stoprow = Trim(.Cells(5, "C").Value)

End With

'處理

Dim i

Dim addcount As Long

With ThisWorkbook.Worksheets("合并結(jié)果")

.Columns(1).ClearContents

For i = startrow To stoprow

addcount = addcount + 1

.Cells(addcount, 1) = ThisWorkbook.Worksheets("原數(shù)據(jù)").Cells(i, 1)

addcount = addcount + 1

.Cells(addcount, 1) = ThisWorkbook.Worksheets("原數(shù)據(jù)").Cells(i, 2)

Next i

.Activate

End With

End Sub

實(shí)例43-一列交叉拆分為兩列


Private Sub CommandButton處理_Click()

With ThisWorkbook.Worksheets("操作界面")

If Trim(.Cells(2, "C").Value) = "" Or Trim(.Cells(5, "C").Value) = "" Then

MsgBox "參數(shù)不能為空"

Exit Sub

End If

'定義變量

Dim startrow As Long

startrow = Trim(.Cells(2, "C").Value)

Dim stoprow As String

stoprow = Trim(.Cells(5, "C").Value)

End With

'處理

Dim i

Dim addcount As Long

With ThisWorkbook.Worksheets("拆分結(jié)果")

.Columns(1).ClearContents

.Columns(2).ClearContents

For i = startrow To stoprow Step 2

addcount = addcount + 1

.Cells(addcount, 1) = ThisWorkbook.Worksheets("原數(shù)據(jù)").Cells(i, 1)

.Cells(addcount, 2) = ThisWorkbook.Worksheets("原數(shù)據(jù)").Cells(i + 1, 1)

Next i

.Activate

End With

End Sub



實(shí)例41-拆分中文英文數(shù)字,實(shí)例42-兩列交叉合并,實(shí)例43-一列交叉拆分為兩列的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
南宫市| 胶州市| 赤峰市| 普宁市| 通江县| 和平区| 会泽县| 宁德市| 曲阜市| 南皮县| 乐亭县| 微博| 九寨沟县| 七台河市| 遂昌县| 和硕县| 静海县| 太谷县| 樟树市| 庄浪县| 泾源县| 随州市| 江安县| 巴东县| 定边县| 驻马店市| 嘉峪关市| 杨浦区| 浦东新区| 仁化县| 惠安县| 郑州市| 昌乐县| 孟村| 武夷山市| 焦作市| 庆云县| 清水县| 徐闻县| 石渠县| 饶平县|