Tecnologia, programação e muito Visual FoxPro.

terça-feira, 28 de dezembro de 2010

Re: ]] XL-mania [[ save as dgn nama worksheet sesuai tanggal

 

mungkin gini:

Private Sub CommandButton1_Click()
   Dim dPath As String, NewFileName As String
   If Range("G69").Value = "NO MATCH" Then
      MsgBox "Jumlah Petikemas Tidak Cocok !!", vbCritical, "DATA ERROR"
      Exit Sub
   Else
      dPath = "\\JPLMKR-01\D\Opd Ecs Interinsuler\Program New\"
      NewFileName = Format(Date, "YYYYMMDD") & "_Mkr_Daily_Position&Summary.xls"
      Range("daily").Copy
      Workbooks.Open Filename:="path" & "YYYYMMDD_Mkr_Daily_Position&Summary.xlt", _
                     ReadOnly:=True
      Activesheet.Range("a1").Select
      ActiveSheet.Paste
      ActiveWorkbook.SaveAs Filename:=dPath & NewFileName
   End If
End Sub

catatan:
jika kita membuka workbook baru maka yg terjadi
workbook baru tsb langsung menjadi ActiveWorkbbok
Sheet1 dlm workbook langsung menjadi ActiveSheet



2010/12/21 Chabink Satriawan <chabink72@gmail.com>

dear pakar xl...

mohon bantuannya dong.. bagaimana caranya agar setelah saya copy suatu file kemudian sy paste ke worksheet lainnya
otomatis nama file awal berubah sesuai nama yg saya berikan dgn tanggal hari ini.. misalnya 20101221_Mkr_Daily_Position&Summary

mohon pencerahan pakar excel sekalian.. berikut saya lampirkan makro saya :

Private Sub CommandButton1_Click()
If Range("G69").Value = "NO MATCH" Then
MsgBox "Jumlah Petikemas Tidak Cocok !!", vbCritical, "DATA ERROR"
End
Else
Range("daily").Copy
Workbooks.Open Filename:="\\JPLMKR-01\D\Opd Ecs Interinsuler\Program New\YYYYMMDD_Mkr_Daily_Position&Summary.xlt", ReadOnly:=True
Worksheets("Sheet1").Range("a1").Select
ActiveSheet.Paste
End If
End Sub
------
tks n rgds

__._,_.___
Recent Activity:
+-:: XL-mania ::::::::::::::::::::----------------------------------+
| groups.yahoo.com/group/XL-mania/files/Zzz_Buffer/snow_flakes.zip  |
| merry x'mas & happy newyear!                                      |
| 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              |
+-------------------------------------------------------------------+
.

__,_._,___

Nenhum comentário:

Arquivo do blog