السلام عليكم .. الله يعطيكم العافية ..
استفسار ( مساعدة ) ...
عندي ماكرو لحفظ شيت اكسل بصيغة pdf ،، وضعته على صورة في شيت يقوم عند الضغط على الصورة بحفظ الشيت نفسه بصيغة pdf ،،
ما اريده هو :: عند الضغط على الصورة ان يحفظ شيت اخر وليس نفس الشيت .. ممكن يكون الحل عن طريق هايبر لينك او تعديل على نفس الماكرو ...
مساعدتكم
الماكرو الحالي ::
Dim ws As Worksheet
Dim strPath As String
Dim myFile As Variant
Dim strFile As String
On Error GoTo errHandler
Set ws = ActiveSheet
'enter name and select folder for file
' start in current workbook folder
strFile = Replace(Replace(ws.Name, " ", ""), ".", "_") _
& "_" _
& Format(Now(), "yyyymmdd\_hhmm") _
& ".pdf"
strFile = ThisWorkbook.Path & "\" & strFile
myFile = Application.GetSaveAsFilename _
(InitialFileName:=strFile, _
FileFilter:="PDF Files (*.pdf), *.pdf", _
Title:="Select Folder and FileName to save")
If myFile <> "False" Then
ws.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=myFile, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
MsgBox "PDF file has been created."
End If
exitHandler:
Exit Sub
errHandler:
MsgBox "Could not create PDF file"
Resume exitHandler
End Sub