您好,代码改成这样
Sub CommandButton1_Click()Open "D:\new.txt" For Output As #1Print #1, Right(Sheets(1).Cells(1, 1).Value, 2)Close #1End Sub
Print #1, Right(Sheets(1).Cells(1, 1).Value, 2)