为另存为宏设置固定另存为类型

时间:2015-09-29 16:42:15

标签: excel vba csv

我一直在使用这个宏,我唯一需要做的就是将Final Sheet保存到CSV文件中。

问题是我需要选择文件的路径和名称。我已经设法打开弹出窗口来保存它,但我需要设置固定的CSV值,是否可能?

这是我的代码

    Sub Fin()
        Sheets("COI").Select
        Columns("A:O").Select
        Selection.Copy
        Sheets("Final").Select
        Columns("A:A").Select
        Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks _
           :=True, Transpose:=False
        On Error Resume Next
        xTitleId = "Selección: "
        Set WorkRng = Application.Selection
        Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
        For Each Rng In WorkRng
        If Rng.Value <> "" Then
        If OutRng Is Nothing Then
        Set OutRng = Rng
        Else
        Set OutRng = Union(OutRng, Rng)
        End If
        End If
        Next
        If Not OutRng Is Nothing Then
        OutRng.Select
        End If
        Selection.Copy
        ActiveSheet.Select
        If MsgBox("¿Está seguro de haber rellenado correctamente la plantilla?", vbQuestion + vbYesNo) = vbYes Then
        ActiveWorkbook.SaveAs Application.Dialogs(xlDialogSaveAs).Show
        MsgBox "Se ha guardado correctamente.", vbInformation
      End If
    End Sub

1 个答案:

答案 0 :(得分:0)

<video src="file://c:/path_to_video/video1.mp4" ...>

应该让你入门。您应该考虑将值赋给变量。