Tecnologia, programação e muito Visual FoxPro.

terça-feira, 15 de setembro de 2009

Re: ]] XL-mania [[ format tanggal exel ke MS word

 

OOm.... saya coba membuat pemecahan masalah dengan menggunakan VBA.
Jadi Konsep berfikirnya :
Data pada cells di Excel di KOPI ke MS Word, berikut ini koding-nya: (File : Excel Terlampir)

...
Puthut Wibowo

Sub CopykeWord()
' Butuh References : Microsoft Word object library caranya : Attacment : Penampakan.pdf
Dim wdApp As Word.Application, wdDoc As Word.Document, ws As Worksheet
    Application.ScreenUpdating = False
    Application.StatusBar = "Buat Dokumen"
    Set wdApp = New Word.Application
    Set wdDoc = wdApp.Documents.Add
    For Each ws In ActiveWorkbook.Worksheets
        Application.StatusBar = "Copying data from " & ws.Name & "..."
        ws.UsedRange.Copy ' Bisa dirubah sesuai range yang ingin di Kopo
        wdDoc.Paragraphs(wdDoc.Paragraphs.Count).Range.InsertParagraphAfter
        wdDoc.Paragraphs(wdDoc.Paragraphs.Count).Range.Paste
        Application.CutCopyMode = False
        wdDoc.Paragraphs(wdDoc.Paragraphs.Count).Range.InsertParagraphAfter
        ' Masukan page break setelah semua woorksheet ke kopi
        If Not ws.Name = Worksheets(Worksheets.Count).Name Then
            With wdDoc.Paragraphs(wdDoc.Paragraphs.Count).Range
                .InsertParagraphBefore
                .Collapse Direction:=wdCollapseEnd
                .InsertBreak Type:=wdPageBreak
            End With
        End If
    Next ws
    Set ws = Nothing
    Application.StatusBar = "Bersihkan......"
    ' normal view
    With wdApp.ActiveWindow
        If .View.SplitSpecial = wdPaneNone Then
            .ActivePane.View.Type = wdNormalView
        Else
            .View.Type = wdNormalView
        End If
    End With
    Set wdDoc = Nothing
    wdApp.Visible = True
    Set wdApp = Nothing
    Application.StatusBar = False
End Sub

Private Sub Cmdjalan_Click()
Call CopykeWord
End Sub



 On Tue, 9/15/09, Antoni Ginting <antoni.ginting@kpi.co.id> wrote:

From: Antoni Ginting <antoni.ginting@kpi.co.id>
Subject: ]] XL-mania [[ format tanggal exel ke MS word
To: "XL-mania@yahoogroups.com" <XL-mania@yahoogroups.com>
Date: Tuesday, September 15, 2009, 8:33 PM

 

Dear Pakar,

 

Setelah berkutat dan coba mencoba, akhirnya ku harus bertanya jg nih. Sepertinya simple tapi tak kudapat.

 

Bagaimana caranya agar format tanggal di excel tidak berubah ketika di merger ke MS word.

 

excel

hasil Merger ke MS word

20-September- 09

09/20/09

22-September- 09

09/22/09

23-September- 09

09/23/09

24-September- 09

09/24/09

25-September- 09

09/25/09

26-September- 09

09/26/09

 

Maunya ketika di merger di word hasilnya tetap seperti format excel.

 

Best Regards,

Antoni Ginting

 


____________ _________ _________ _________ _________ _________ _________ _________ _________ _________ _________ ________

Disclaimer :
____________ _________ _________ _________ _________ _________ _________ _________ _________ _________ _________ ________

This message is intended for the lawful recipient(s) explicitly stated in above only.
It may contain confidential information prohibited for any Unauthorized use by any party
other than the lawful addressee. The message, information and statement expressed herein
should also be legally privileged for the lawful recipient(s) .

If you are not the intended recipient(s) or person responsible for delivering it to the intended recipient(s) ,
you must therefore be notified not to copy, print, distribute or take any action in
reliance on it, directly or indirectly.
____________ _________ _________ _________ _________ _________ _________ _________ _________ _________ _________ ________
Please consider ENVIRONTMENT before PRINTING this email .

__._,_.___
+-:: XL-mania ::::::::::::::::::::----------------------------------+
| THR kecil sekali akibat pindah-pindah kerja :D :D :D              |
| http://www.facebook.com/group.php?gid=37671048001&ref=mf          |
+-------------------------------------------------------------------+
| DILARANG : MLM, money game, OOT, iklan tanpa izin, SARA, testing, |
| pembicaraan pribadi, one line message,  melecehkan,  tidak sopan. |
+-------------------------------------------------------------------+
| Buat subjek yang kreatif, jangan : "tanya", "help", "mohon bantu" |
| Usahakan besar attachment < 200 kb. Gunakan  winzip  jika  perlu. |
+-------------------------------------------------------------------+
| Ajak teman-teman Anda bergabung dengan mengirim e-mail kosong ke  |
| XL-mania-subscribe@yahoogroups.com atau kirimkan mereka file dari |
| http://groups.yahoo.com/group/XL-mania/files/Promotion/           |
+-------------------------------------------------------------------+
| Berikan testimoni di : http://www.friendster.com/xlmania atau...  |
| http://www.xl-mania.com/2008/06/testimoni-xl-mania.html           |
+-------------------------------------------------------------------+
| Message lama ada di :                                             |
| http://groups.yahoo.com/group/XL-mania/messages [perlu yahoo id]  |
| http://www.mail-archive.com/xl-mania@yahoogroups.com              |
+-------------------------------------------------------------------+
Recent Activity
Visit Your Group
Give Back

Yahoo! for Good

Get inspired

by a good cause.

Y! Toolbar

Get it Free!

easy 1-click access

to your groups.

Yahoo! Groups

Start a group

in 3 easy steps.

Connect with others.

.

__,_._,___

Nenhum comentário:

Arquivo do blog