simpan file dengn target sendiri

  1. 5 minggu lalu

    Dear All
    MohonBantuannya ,jika pada aasat sya ingin simpan file excel,tapi targetnya kita pilih foldernya ,cranya bamana yah

    terlapir rumus sya pake ,mngkin ada yg mau dirubah

    Public Sub export()

    Dim Alamat As String
    Dim nama As String

    Alamat = ThisWorkbook.Path & "\HASIL\"
    nama = Sheet6.Range("B1").Value

    Sheet6.Range("B1:J45").Copy

    Workbooks.Add
    Range("A2:I45").PasteSpecial xlPasteColumnWidths
    Range("A2:I45").PasteSpecial xlPasteValues
    Range("A2:I45").PasteSpecial xlPasteFormats

    ActiveWorkbook.SaveAs (Alamat & nama & ".xlsx")
    ActiveWorkbook.Close (False)

    MsgBox "Data Berhasil Disimpan"

    End Sub

  2. Masdad

    Okt 25 Terverifikasi Demak + 2.030 Poin

    Mungkin begini:

    Public Sub export()
    Dim NamaFile As String
    Dim sFileSaveName As Variant
    NamaFile = Sheet6.Range("B1").Value
    sFileSaveName = Application.GetSaveAsFilename(InitialFileName:=NamaFile, fileFilter:="Excel Files (*.xlsx), *.xlsx")
    If sFileSaveName <> False Then
    
    Sheet6.Range("B1:J45").Copy
    
    Workbooks.Add
    Range("A2:I45").PasteSpecial xlPasteColumnWidths
    Range("A2:I45").PasteSpecial xlPasteValues
    Range("A2:I45").PasteSpecial xlPasteFormats
    
    ActiveWorkbook.SaveAs sFileSaveName
    ActiveWorkbook.Close (False)
    
    MsgBox "Data Berhasil Disimpan"
    End If
    End Sub

  3. Dear @Masdad Terimakasih bnyak bantuannya

 

atau Mendaftar untuk ikut berdiskusi!