Merhaba arkadaşlar. Aşağıda Necdet Yeşertener üstadımızın bir kodu bulunuyor. Bu kod bir hücreyi aktarıyor. Acaba alan aktarımı için nasıl revize etmek gerekir. Örneğin A1:B3 için.
Private Sub CommandButton1_Click()
Dim NewXL As Excel.Application
Dim DataWB As String
Dim NoA As Long
Dim Wb As Workbook
Set NewXL = New Excel.Application
NewXL.Visible = False
Dosya = InputBox("Dosya Adını Giriniz", "Dosya Adı Girişi", "KapaliDosya")
If Dosya = "" Then Exit Sub
DataWB = ThisWorkbook.Path & Application.PathSeparator & Dosya & ".xls"
Set Wb = NewXL.Workbooks.Open(DataWB, Password:="aa")
Wb.Sheets("Sayfa1").Range("E4") = Range("A2")
NewXL.Workbooks(Dir(DataWB)).Close SaveChanges:=True
[A2].ClearContents
Set Wb = Nothing
Set NewXL = Nothing
MsgBox "İşlem Tamamdır .........."
End Sub
Private Sub CommandButton1_Click()
Dim NewXL As Excel.Application
Dim DataWB As String
Dim NoA As Long
Dim Wb As Workbook
Set NewXL = New Excel.Application
NewXL.Visible = False
Dosya = InputBox("Dosya Adını Giriniz", "Dosya Adı Girişi", "KapaliDosya")
If Dosya = "" Then Exit Sub
DataWB = ThisWorkbook.Path & Application.PathSeparator & Dosya & ".xls"
Set Wb = NewXL.Workbooks.Open(DataWB, Password:="aa")
Wb.Sheets("Sayfa1").Range("E4") = Range("A2")
NewXL.Workbooks(Dir(DataWB)).Close SaveChanges:=True
[A2].ClearContents
Set Wb = Nothing
Set NewXL = Nothing
MsgBox "İşlem Tamamdır .........."
End Sub
