- Katılım
- 3 Nisan 2012
- Mesajlar
- 41
- Excel Vers. ve Dili
- 2010 türkçe
merhaba arkadaşlar
ufak bi sorum olacak aşağıdaki kodla bi excel çalışma kitabından bi word belgesine veri aktarıyorum ama sadece bir sayfa aktara biliyorum 2-3-4 hatta 5. sayfaları nasıl aktarabilirim acaba bu kullandığım dosyayı ve kodu ekliyorum beni bu 4 butonu kullanmaktan kurtarabilecek bi arkadaşım varmı acaba.
şimdiden tşk ler.
Private Sub CommandButton2_Click()
Set s1 = Sheets("ALA-DİK KAYIT")
Set s2 = Sheets("ALA-DİK KAYIT")
yol = ThisWorkbook.Path & "\dosyalar\"
Application.ScreenUpdating = False
Set wd = CreateObject("Word.Application")
Set wddoc = wd.Documents.Add(DocumentType:=0)
wd.Visible = False
For x = 1 To s1.Cells(Rows.Count, 1).End(3).Row
If s1.Cells(x, 1) <> "" Then
s2.[k4] = s1.Cells(x, 1)
s2.Range("B1:H21").CopyPicture
wd.ActiveDocument.Bookmarks("\page").Range.Delete
wd.Selection.Paste
wddoc.SaveAs yol & s2.[G35].Text & "" & ".doc"
End If
Next
wd.Visible = True
wddoc.Application.Quit
Application.CutCopyMode = False
Application.ScreenUpdating = True
MsgBox "DOSYALARIMA KAYDEDİLDİ...", vbInformation, "CELL-O"
End Sub
ufak bi sorum olacak aşağıdaki kodla bi excel çalışma kitabından bi word belgesine veri aktarıyorum ama sadece bir sayfa aktara biliyorum 2-3-4 hatta 5. sayfaları nasıl aktarabilirim acaba bu kullandığım dosyayı ve kodu ekliyorum beni bu 4 butonu kullanmaktan kurtarabilecek bi arkadaşım varmı acaba.
şimdiden tşk ler.
Private Sub CommandButton2_Click()
Set s1 = Sheets("ALA-DİK KAYIT")
Set s2 = Sheets("ALA-DİK KAYIT")
yol = ThisWorkbook.Path & "\dosyalar\"
Application.ScreenUpdating = False
Set wd = CreateObject("Word.Application")
Set wddoc = wd.Documents.Add(DocumentType:=0)
wd.Visible = False
For x = 1 To s1.Cells(Rows.Count, 1).End(3).Row
If s1.Cells(x, 1) <> "" Then
s2.[k4] = s1.Cells(x, 1)
s2.Range("B1:H21").CopyPicture
wd.ActiveDocument.Bookmarks("\page").Range.Delete
wd.Selection.Paste
wddoc.SaveAs yol & s2.[G35].Text & "" & ".doc"
End If
Next
wd.Visible = True
wddoc.Application.Quit
Application.CutCopyMode = False
Application.ScreenUpdating = True
MsgBox "DOSYALARIMA KAYDEDİLDİ...", vbInformation, "CELL-O"
End Sub
