第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

使用 VBA/Python 在 Excel 中格式化和修改字符串

使用 VBA/Python 在 Excel 中格式化和修改字符串

阿晨1998 2021-07-30 13:08:17
我正在嘗試編寫一個(gè) VBA 腳本,它通過一列單元格和一個(gè)單元格,在 html<u></u>標(biāo)簽和兩個(gè)標(biāo)簽之間的文本下劃線,然后從文本中刪除這些標(biāo)簽。單元格內(nèi)部可能有多個(gè)標(biāo)簽,它們旁邊有其他文本,或者根本沒有標(biāo)簽。到目前為止,我已經(jīng)能夠讓腳本在標(biāo)簽之間加下劃線,但是當(dāng)我嘗試刪除它們時(shí),沒有任何效果(有時(shí)什么都沒有改變,有時(shí)標(biāo)簽帶有下劃線等)。為簡(jiǎn)潔起見,我省略了輸入/輸出示例,并希望我的代碼存在明顯的問題,但可應(yīng)要求提供。嘗試使用 VBA 解決這個(gè)問題最初源于我無法在 Python 中執(zhí)行此操作,因?yàn)閷?duì)象模型僅與單元格一樣低,而不是單元格的內(nèi)容。任何使用 Python 執(zhí)行此操作的解決方案也將不勝感激!非常感謝你的幫助!如果還有什么我能做的來幫助大家,請(qǐng)告訴我!Sub PleaseUnderline()'Holds the content between the tagsDim s As String'Holds the row number of the active cellDim a As Integer'Holds the location of the beginning of the open tagDim b As Integer'Holds the location of the beginning of the close tagDim e As IntegerDim holder As String    'Select the last cell in column A and make it the active cell    Range("A" & ActiveCell.SpecialCells(xlLastCell).Row).Select    For a = ActiveCell.Row To 1 Step -1        Range("A" & a).Select        holder = Range("A" & a).Value        s = ""        b = 1        e = 1        Do            b = InStr(b, ActiveCell, "<u>")            If b = 0 Then Exit Do            e = b + 1            e = InStr(e, ActiveCell, "</u>")            If e = 0 Then                Exit Do            Else                s = Mid(ActiveCell, b + 3, e - b - 3)            End If            holder = Replace(holder, "<u>", "", 1, 1)            holder = Replace(holder, "</u>", "", 1, 1)            Worksheets("Sheet").Range("A" & a).Value = holder            ActiveCell.Characters(b, Len(s)).Font.Underline = True            b = e + 1        Loop    Next aEnd Sub
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 238 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)