Tampilkan postingan dengan label if file exist. Tampilkan semua postingan
Tampilkan postingan dengan label if file exist. Tampilkan semua postingan

Senin, 11 Maret 2013

Tehnik dalam menggunakan Macro untuk yang tidak seragam atau tidak standar.

Ada kalanya kita menemukan masalah dimana macro tidak bisa memecahkan masalah otomatisasi kita, mungkin ada penyelesaiannya tapi kita aja yang tidak atau belum menemukannya. saat menghadapi masalah seperti ini kita bisa menyelesaikannya dengan menggunakan tehnik tehnik tertentu. diantaranya bisa dengan menggunakan file dummy, atau kolom dummy atau kolom atau range sementara untuk perhitungan tertentu yang nanti bisa disambung sambung dan hasil akhirnya bisa menemukan pemecahan masalah. 
contoh :
  • Seringkali untuk rumus logika IF kalau tidak salah hanya dibatasi sampai dengan 7 kriteria untuk slebihnya bisa menggunakan kolom dummy yaitu misal kriteria s/d 40 kriteria kolom dummy 1 untuk rumus if sampai kriteria ke tujuh, lalu jika hasil kom dummy 1 masih belum ketemu di buat kolom dummy 2 sampai kriteria ke 14, dst sampai buat 6 kolom dummy.
  • kolom dummy terakhir disini 6, dibikin resume atau hasil rekap semua kolom dummy. dengan rumus =kolom dummy1&kolom dummy2&kolom dummy3&kolom dummy4&kolom dummy5 atau = kolom dummy1+kolom dummy2+kolom dummy3+kolom dummy4+kolom dummy5

Selasa, 05 Juli 2011

COPY FILE MENGGUNAKAN MACRO EXCEL VBA








BERIKUT ADALAH RUMUS FORMULA UNTUK MENYALIN FILE



MENGGUNAKAN EXCEL VBA.


























No rumus keterangan
1 How to get the active station and folder name: MsgBox "Active station and folder name: " & CurDir How to change the active station: ChDrive "F" ' changes to the F-station How to change the active folder: ChDir "F:\My Documents\Private" How to determine if a file exists in a folder: If Dir("F:\My Documents\My Workbook.xls") <> "" Then ' the file exists, returns "" (empty string) if the file doesn't exist. How to delete a file : Kill "F:\My Documents\My Workbook.xls" If you don't specify the station, Excel uses the active station. If you don't specify the folder, Excel uses the active folder. How to create a new folder: MkDir "NewPrivateFolder" ' creates a new folder in the active folder MkDir "F:\My Documents\NewPrivateFolder" ' creates a new folder in the existing folder F:\My Documents How to delete a folder (folder must be empty): RmDir "NewPrivateFolder" ' deletes the subfolder NewPrivateFolder in the active folder RmDir "F:\My Documents\NewPrivateFolder" ' deletes the subfolder NewPrivateFolder in the folder F:\My Documents How to copy a file (the file must be closed): FileCopy "OrgWorkBook.xls", "CopyWorkBook.xls" ' copies OrgWorkBook.xls to CopyWorkBook.xls in the active folder FileCopy "OrgWorkBook.xls", "F:\My Documents\CopyWorkBook.xls" ' copies OrgWorkBook.xls from the active folder to F:\My Documents\CopyWorkBook.xls How to move a file (the file must be closed): OldFilePath = "C:\OldFolder\Filename.xls" ' original file location NewFilePath = "C:\NewFolder\Filename.xls" ' new file location Name OldFilePath As NewFilePath ' move the file
2

Sum


ber

Semua petunjuk diatas diambil dari situs di samping : http://www.exceltip.com/st/Basic_file_and_folder_examples_using_VBA_in_Microsoft_Excel/443.html
c c c








Kegunaannya adalah kita dapat mengcopy file apapun atau backup, hapus hanya dengan membuka atau menjalankan macro dari excel atau membuat tombol di file excel untuk menjalankan proses copy file

Page View