質問です
下記マクロで1行目を削除するようになっていると思いますが
それを取り消すまくろに修正の仕方を教えてください
Option Explicit
Sub delTopLineSub(path As String, fname As String)
Dim buf As String
Dim fname1 As String, fname2 As String
fname1 = path & fname
fname2 = path & fname & ".$$$"
Open fname1 For Input As #1
Open fname2 For Output As #2
Line Input #1, buf '1行目読み飛ばし
Do Until EOF(1)
Line Input #1, buf
Print #2, buf
Loop
Close #1
Close #2
Kill fname1
Name fname2 As fname1
End Sub
Sub hogeRename(path As String, ext As String, pat As String)
Dim fname As String
Dim re As Object, mat As Object
fname = Dir(path & "*." & ext, vbNormal)
Set re = CreateObject("VBScript.RegExp")
With re
.Pattern = pat
.IgnoreCase = True
.Global = True
Do While fname <> ""
Set mat = .Execute(fname)
If mat.Count > 0 Then
Call delTopLineSub(path, fname)
Name path & fname As path & re.Replace(fname, "")
End If
fname = Dir()
Loop
End With
Set mat = Nothing
Set re = Nothing
End Sub
Sub main31()
Call hogeRename("C:\test-do\", "txt", "^[0-9]{2}\-")
End Sub