- Katılım
- 2 Mart 2005
- Mesajlar
- 2,960
- Excel Vers. ve Dili
-
ev: Ofis 2007- Win Xp
iş: Ofis 2010- Win Vista
Aşağıdaki kodlar sorunsu çalışıyor, ancak
ben aşağıdaki şekilde kullanmak istiyorum
nasıl bir değişklik yapmalıyım
Kod:
Sub Alansec()
SnDlSt = [d65536].End(3).Row '55
Range("A1:G" & SnDlSt).Select: Selection.Copy
Call SeciliAlaniWordeYapistir_D
End Sub
Private Sub SeciliAlaniWordeYapistir_D()
'A4 sayfa yapısı dikeydir
Application.ScreenUpdating = True
'Range("A1:L5" & SnDlSt + 7).Copy
Set objword = CreateObject("Word.Application")
Set Mydoc = objword.Documents.Add(DocumentType:=wdNewBlankDocument)
objword.Visible = True
With Mydoc.PageSetup
.TopMargin = 42.55
.BottomMargin = 42.55
.LeftMargin = 25#
.RightMargin = 25#
.PageWidth = 595.35 'CentimetersToPoints(21)
.PageHeight = 841.95 'CentimetersToPoints(29,7)
End If
End With
objword.Selection.PasteSpecial Link:=False, DataType:=10
Application.CutCopyMode = False
Set objword = Nothing: Set Mydoc = Nothing
Application.ScreenUpdating = False
End Sub
Kod:
Sub Alansec()
SnDlSt = [d65536].End(3).Row '55
Range("A1:G" & SnDlSt).Select: Selection.Copy
[color="red"] Call SeciliAlaniWordeYapistir_D (üst,alt,sağ,sol,yon) [/color]
End Sub
Private Sub SeciliAlaniWordeYapistir_D()
'A4 sayfa yapısı dikeydir
Application.ScreenUpdating = True
'Range("A1:L5" & SnDlSt + 7).Copy
Set objword = CreateObject("Word.Application")
Set Mydoc = objword.Documents.Add(DocumentType:=wdNewBlankDocument)
objword.Visible = True
With Mydoc.PageSetup
[color="red"] .TopMargin = ust
.BottomMargin = alt
.LeftMargin = sol
.RightMargin = sag
If yon = "dky" Then [/color]
.PageWidth = 595.35 'CentimetersToPoints(21)
.PageHeight = 841.95 'CentimetersToPoints(29,7)
Else
.PageWidth = 841.95 'CentimetersToPoints(29.7) 'yataysayfa
.PageHeight = 595.35 'CentimetersToPoints(21) 'yataysayfa
End If
End With
objword.Selection.PasteSpecial Link:=False, DataType:=10
Application.CutCopyMode = False
Set objword = Nothing: Set Mydoc = Nothing
Application.ScreenUpdating = False
End Sub
nasıl bir değişklik yapmalıyım
Son düzenleme: