从超过20个字符长的行中删除前两个引号

时间:2017-03-29 08:57:22

标签: excel vba excel-vba

我几年没有写任何VBA,所以生锈了,我会很感激帮助。

我有一个包含大约9k行文本的文件,我需要一个脚本,它将从超过20个字符的任何行中删除前两个引号。

我该怎么做?

更新

我有这个选择超过20个字符的行,但不知道如何删除前两个引号:

Sub Sanitise()

Dim sh As Worksheet
Dim rw As Range

RowCount = 0

Set sh = ActiveSheet
For Each rw In sh.Rows

    If Len(sh.Cells(rw.Row, 1).Value) > 20 Then
    ' Need to remove the first two quotes
    End If

Next rw

End Sub

数据:

  

A00,408," UXS",201309,10X641,00110 U02,99400," 200X601"," E"," N&#34 ;," 38418"" 064X09"" 00""""""""&#34 ;, "   """""" E""""" S72," MXRE0042" S72," MRE0047" S72," MRE0047"   U02,7514100," 201613"" E"" N"" 66620""
  21011X"" 00""""""""&#34 ;, " """""" E""""" S72," MRE00432"   S72," MRE00457" S72," MRE00417" U02,7513770602," 20X12"" E"" N"" 40761""   12775X"" 00""""""""&#34 ;, " """""" E""""" S72," MRE00432"   S72," MRE00X47" S72," MRE004X7"

1 个答案:

答案 0 :(得分:2)

这样的内容将通过A列并使用变量数组删除长度超过20个字符的字符串中的前两个GenerableParameter

代码将更新的字符串转储到B列。

"