Modificar macro ya editada que guarda hoja excel, para que guarde fórmulas, etc

Estoy usando una macro ya editada por DAM que guarda hoja de excel en carpeta según ruta, pero no guarda las fórmulas me gustaría si es posible que guardara las fórmulas respetando la ruta donde se guarda, etc.

Te envío la macro un saludo

Juan

Sub GUARDA_EN_EXCEL_Haga_clic_en()
'Por.dam
On Error Resume Next
Set h1 = ActiveSheet
h1.Unprotect
h1.Copy
h1.Protect
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Set navegador = CreateObject("shell.application")
carpeta = navegador.browseforfolder(0, _
"SELECCIONE UNA CARPETA PARA COPIAR EL ARCHIVO", 0, "Mis Documentos:\").items.Item.Path
If carpeta <> "" Then
If Right(carpeta, 1) <> "\" Then
carpeta = carpeta & "\"
End If
If Range("C10") <> "" Then
arch = Range("F11") & " " & Range("H11") & " " & Range("C10")
Else
arch = "archivo"
End If
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=carpeta & arch & ".xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False
End If
End Sub

1 Respuesta

Respuesta
3

Te anexo la macro actualizada.

Sub GUARDA_EN_EXCEL_Haga_clic_en()
'Por.Dante Amor
    On Error Resume Next
    Set h1 = ActiveSheet
    h1.Unprotect
    h1.Copy
    h1.Protect
    Application.CutCopyMode = False
    Set navegador = CreateObject("shell.application")
    carpeta = navegador.browseforfolder(0, _
    "SELECCIONE UNA CARPETA PARA COPIAR EL ARCHIVO", 0, "Mis Documentos:\").items.Item.Path
    If carpeta <> "" Then
        If Right(carpeta, 1) <> "\" Then carpeta = carpeta & "\"
        If Range("C10") <> "" Then
            arch = Range("F11") & " " & Range("H11") & " " & Range("C10")
        Else
            arch = "archivo"
        End If
        Application.DisplayAlerts = False
        ActiveWorkbook.SaveAs Filename:=carpeta & arch & ".xls", FileFormat:=xlNormal
    End If
End Sub

Saludos.Dante Amor

No olvides valorar la respuesta.

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas