Dear Pak Sudarsono,

Makasih yaaa buat solusinya..
Jujur masih meraba2 banget masalah makro dan VBA ini..
dulu dengan pasrah ngerjain manual sampe suatu ketika menyadari bahwa itu bisa pake makro *baru nyadar 1 tahun yg lalu setelah 4 tahun manual :-[ :'( *

Tadi pagi dikasih solusi seperti itu sempet shock..
abis ga ngerti..
jadi dikutak katik kutak katik..
dicoba-coba error, debug *gedebug* akhirnya sukses dengan memasukkan bagian kecil dari yang bapak kasih ke dalam makro saya sebelumnya
   Dim barisawal, barisakhir As Long
   barisawal = 10
   Range("A" & barisawal).Select
   Selection.End(xlDown).Select
   barisakhir = Selection.Row
   Range("A" & barisawal & ":K" & barisakhir).Select
untuk mengerjakan format bordernya..
dan suksessss... hehehehehehe *bahagia*

Dan barusan dengan dodolnya, pas nyoba lagi pake cara dari bapak..
lah kok lancar.. *gubraaakk* hahahahaha..
jadi punya 2 sekarang..

Btw, makasih ya pak..
apa yang membuat saya penasaran selama ini jadi terpecahkan..

Thanks Be-excel..

Sincerely,
Santi Rosaindah


*There will always be Sun-SHinE after the rain*


Sudarsono Suhenk wrote:
Dari sheet tampak bahwa total , belum ada rumusnya . dan Sheet hasil juga . apa memang manual . kalau rumusnya : total = Qty* UnitPrice. maka perlu penulisan ulang makroutama :
' paling atas sebelum makro atau subrutin yang lain
Dim barisawal, barisakhir As Long
' ini makro yang diperlukan
Sub FormatFormula()
    barisawal = 11
'===
    Call formatjudul
'----
    Range("A" & barisawal).Select  ' awal sel tabel
    Selection.End(xlDown).Select
    barisakhir = Selection.Row
    Range("A" & barisawal & ":K" & barisakhir).Select
    Call formatisi
'   rumus total
    Call rumustotal
'  summary
    Range("F" & barisakhir + 1).Select
    Call formatFooter
ActiveCell.FormulaR1C1 = "=SUM(R[-" & ba risakhir - barisawal + 1 & "]C:R[-1]C)"
'   Responsibilty
    Range("K" & barisakhir + 1).Select
    Call formatFooter
'   proposed , menentukan warna yang sesuai
    Range("H" & barisawal & ":H" & barisakhir).Select
    Call formatKondisional
End Sub

Sub rumustotal()
    Range("F" & barisawal).Select
    ActiveCell.FormulaR1C1 = "=RC[-2]*RC[-1]"
    Application.CutCopyMode = False
    Selection.Copy
    Range("F" & barisawal + 1 & ":F" & barisakhir).Select
    MsgBox Selection.Address
    Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
End Sub

 Sub formatKondisional()
    Cell s.FormatConditions.Delete
Selection.FormatCondi tions.Add Type:=xlCellValue, Operator:=xlEqual, _
        Formula1:="=""pengiriman"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .ThemeColor = xlThemeColorAccent2
        .TintAndShade = 0.599963377788629
    End With
    Selection.FormatConditions(1).StopIfTrue = True
End Sub

------------------------------------------------------------------------
To: belajar-excel@yahoogroups.com
From: jkss...@live.com
Date: Thu, 23 Jun 2011 09:00:39 +0700
Subject: RE: [belajar-excel] Tanya: merapikan tabel dengan makro

ada saja yang kurang nih, maklum terburu-buru. pagi2 baca milis be-excel, baru mau mulai kerja. sebab ini kesenangan saya ( vba ), daripada di dahuluin yang lain....Rolling on the floor laughing ( just kiding Hooi ). ActiveCell.FormulaR1C1 = "=SUM(R[-3]C:R[-1]C)"

ganti menjadi:

ActiveCell.FormulaR1C1 = "=SUM(R[-" & barisakhir - barisawal + 1 & "]C:R[-1]C)" ------------------------------------------------------------------------
To: belajar-excel@yahoogroups.com
From: jkss...@live.com
Date: Thu, 23 Jun 2011 08:54:08 +0700
Subject: RE: [belajar-excel] Tanya: merapikan tabel dengan makro

sori , ada yang ketinggalan yaitu Call formatisi .

Range("A" & barisawal & ":K" & barisakhir).Select
Call formatisi
' summary
------------------------------------------------------------------------
To: belajar-excel@yahoogroups.com
From: jkss...@live.com
Date: Thu, 23 Jun 2011 08:47:20 +0700
Subject: RE: [belajar-excel] Tanya: merapikan tabel dengan makro

ADF
        
        
        
        
        
        
        
        
        

        
        
        
        
        
        
        
        
        
        
Periode From    5/1/2011        
        
        
        
        
        
        
        
        
Periode To      5/31/2011       
        
        
        
        
        
        
        
        
Company         20      Toko A  
        
        
        
        
        
        
        
Dept Name       HRD     
        
        
        
        
        
        
        
        

        
        
        
        
        
        
        
        
        
        
NO KLS DESCRIPTION QTY UNITPRICE TOTAL Kondisi PROPOSED CAUSED BY APPROVED RESPONSIBILITY OF A1 K245 kursi 1 100,000 100,000 retak repair Handling di store repair di store A2 K624 kursi 1 100,000 100,000 retak repair Handling di store repair di store A3 K921 meja 1 200,000 100,000 retak Pengiriman Handling di store repair di store
        
        
        
        
        300,000         
        
        
        
macro utama :
Sub FormatFormula()
            .
            .
    Range("A" & barisawal & ":K" & barisakhir).Select
    Call formatisi

'  summary
    Range("F" & barisakhir + 1).Select
           .
           .
End Sub

untuk sub rutin formatjudul , formatisi dan formatFooter , ambil saja koding anda . Karena hanya menentukan lebar kolom, tinggi baris dan border.

untuk kondisiona format gunakan sub rutin berikut :
Sub formatKondisional()
              .
    ActiveCell.FormulaR1C1 = "=SUM(R[-3]C:R[-1]C)"
              .
End Sub

Semoga sesuai
------------------------------------------------------------------------
To: belajar-excel@yahoogroups.com
From: santi.rosain...@indexfurnishings.com
Date: Wed, 22 Jun 2011 15:21:13 +0700
Subject: [belajar-excel] Tanya: merapikan tabel dengan makro

Dear all,

Saya punya contoh data seperti terlampir.
kendalanya, kalau dibagian responsibility kosong, maka ketika makro
dijalankan, maka bordernya sampai akhir baris.
maunya terborder sampai baris yang sama dengan kolom sebelahnya

Mohon bantuan infonya untuk bahasa VBAnya seperti apa yaa?

Terima kasih

--
Sincerely,
Santi Rosaindah

*There will always be Sun-SHinE after the rain*

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.









--
This message has been scanned for viruses and
dangerous content, and is
believed to be clean.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply via email to