اذهب الي المحتوي
أوفيسنا

الردود الموصى بها

قام بنشر

السادة اعضاء المنتدي الكرام

السلام عليكم وكل عام وانتم بخير

جعل الله كل ما تقدمونه من علم في ميزان حسناتكم ان شاء الله

ولي سؤال عندكم

عندي ورقة عمل تحتوي بداخلها علي اكثر من شيت

واريد ان يتم حفظ كل شيت كورقة عمل مستقلة

فكيف يمكن عمل ذلك ؟

وجزاكم الله خيرا

والسلام عليكم ورحمة الله وبركاته

قام بنشر

السلام عليكم

قمت بالبحث ووجدث هذا الكود في احدي المواقع

اتمني ان يستفيد منه الجميع

والسلام عليكم

Sub CreateWorkbooks()

'Creates an individual workbook for each worksheet in the active workbook.

Dim wbDest As Workbook

Dim wbSource As Workbook

Dim sht As Object 'Could be chart, worksheet, Excel 4.0 macro,etc.

Dim strSavePath As String

On Error GoTo ErrorHandler

Application.ScreenUpdating = False 'Don't show any screen movement

strSavePath = "C:\Temp\" 'Change this to suit your needs

Set wbSource = ActiveWorkbook

For Each sht In wbSource.Sheets

sht.Copy

Set wbDest = ActiveWorkbook

wbDest.SaveAs strSavePath & sht.Name

wbDest.Close 'Remove this if you don't want each book closed after saving.

Next

Application.ScreenUpdating = True

Exit Sub

ErrorHandler: 'Just in case something hideous happens

MsgBox "An error has occurred. Error number=" & Err.Number & ". Error description=" & Err.Description & "."

End Sub

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information