• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

2 Hücredeki veri dosya adı olsun, otomatik kaydetsin

  • Konbuyu başlatan Konbuyu başlatan neka75
  • Başlangıç tarihi Başlangıç tarihi
Katılım
20 Ekim 2008
Mesajlar
19
Excel Vers. ve Dili
2003 - TURKÇE
Aşağıdaki kod ile çalışma sayfalarının bazılarını başka sayfa olarak kaydedebiliyorum,

Yapmak istediğim proforma sayfasında hücreye girdiğim dosya adı kayıt ettiğim dosya olsun.

Option Explicit

Sub TwoSheetsAndYourOut()
Dim NewName As String
Dim nm As Name
Dim ws As Worksheet

If MsgBox("Bu dosyayı kayıt etmek istiyormusunuz?" & vbCr & _
"" _
, vbYesNo, "Uyarı") = vbNo Then Exit Sub

With Application
.ScreenUpdating = False

' Copy specific sheets
' *SET THE SHEET NAMES TO COPY BELOW*
' Array("Sheet Name", "Another sheet name", "And Another"))
' Sheet names go inside quotes, seperated by commas
On Error GoTo ErrCatcher
Sheets(Array("proforma", "packinglist")).Copy
On Error GoTo 0

' Paste sheets as values
' Remove External Links, Hperlinks and hard-code formulas
' Make sure A1 is selected on all sheets
For Each ws In ActiveWorkbook.Worksheets
ws.Cells.Copy
ws.Cells.PasteSpecial Paste:=xlValues
ws.Cells.Hyperlinks.Delete
Application.CutCopyMode = False
Cells(1, 1).Select
ws.Activate
Next ws
Cells(1, 1).Select

' Remove named ranges
For Each nm In ActiveWorkbook.Names
nm.Delete
Next nm

' Input box to name new file
NewName = InputBox("(Müşteri adı ve tarih girin)dd.mm.yyyy", "Yeni Kayıt")

' Save it with the NewName and in the same directory as original
ActiveWorkbook.SaveCopyAs ThisWorkbook.Path & "\" & NewName & ".xls"
ActiveWorkbook.Close SaveChanges:=False

.ScreenUpdating = True
End With
Exit Sub

ErrCatcher:
MsgBox "Specified sheets do not exist within this workbook"
End Sub
 
NewName = InputBox("(Müşteri adı ve tarih girin)dd.mm.yyyy", "Yeni Kayıt")

Yukarıdaki satırı aşağıdaki ile değiştirerek deneyin. Dosya adının A1 hücresinden alındığı kabul edilmiştir.

NewName =sheets("proforma").range("A1")
 
Teşekkür ederim, elinize sağlık, çok işime yaradı,

aynı sayfadaki 2 veya 3 hücredeki değeri de yapabilirmiyiz.
 
Son düzenleme:
Geri
Üst