Lepi,

Sepertinya kalau excel jadinya dilampirkan bisa lebih membantu deh. Pusing juga 
kalau lihat kode aja tanpa tahu hasil akhirnya seperti apa.


--- On Tue, 3/16/10, l3p15 <[email protected]> wrote:

From: l3p15 <[email protected]>
Subject: ]] XL-mania [[ modify macro
To: [email protected]
Date: Tuesday, March 16, 2010, 7:04 AM







 



  


    
      
      
      RR,



Salam kenal RR XL-mania,

Saya masih newbie banget di milist maupun di XL application ini dan skrg lagi 
mencoba belajar membuat looping buat macro sederhana guna menunjang kerjaan 
sekaligus mendalami excel appl.



saya punya macro manual spt ini yg sangat statis dan skrg saya mencoba untuk 
menggantinya dengan looping.



Sub Define_ExtGsmCell( )

'

' Define_ExtGsmCell Macro

' parsing

'

' Keyboard Shortcut: Ctrl+a

'

    ActiveCell.FormulaR 1C1 = "= ""cr RncFunction= 1,ExternalGsmNet 
work=1,ExternalG smCell="" &input!R[ 1]C[1]"

    Range("A2"). Select

    ActiveCell.FormulaR 1C1 = "= input!RC&"" #cell id"""

    Range("A3"). Select

    ActiveCell.FormulaR 1C1 = "= input!R[-1]C[ 3]&"" #ncc"""

    Range("A4"). Select

    ActiveCell.FormulaR 1C1 = "= input!R[-2]C[ 4]&"" #bcc"""

    Range("A5"). Select

    ActiveCell.FormulaR 1C1 = "= input!R[-3]C[ 5]&"" #bcchfrequency" ""

    Range("A6"). Select

    ActiveCell.FormulaR 1C1 = "= input!R[-4]C[ 6]&"" #lac"""

    Range("A1"). Select

    Selection.Copy

    Range("A7"). Select

    ActiveSheet. Paste

    Application. CutCopyMode = False

    ActiveCell.FormulaR 1C1 = "= ""cr RncFunction= 1,ExternalGsmNet 
work=1,ExternalG smCell="" &input!R[ -4]C[1]"

    Range("A2"). Select

    Selection.Copy

    Range("A8"). Select

    ActiveSheet. Paste

    Application. CutCopyMode = False

    ActiveCell.FormulaR 1C1 = "= input!R[-5]C& "" #cell id"""

    Range("A3"). Select

    Selection.Copy

    Range("A9"). Select

    ActiveSheet. Paste

    Application. CutCopyMode = False

    ActiveCell.FormulaR 1C1 = "= input!R[-6]C[ 3]&"" #ncc"""

    Range("A4"). Select

    Selection.Copy

    Range("A10") .Select

    ActiveSheet. Paste

    Application. CutCopyMode = False

    ActiveCell.FormulaR 1C1 = "= input!R[-7]C[ 4]&"" #bcc"""

    Range("A5"). Select

    Selection.Copy

    Range("A11") .Select

    ActiveSheet. Paste

    Application. CutCopyMode = False

    ActiveCell.FormulaR 1C1 = "= input!R[-8]C[ 5]&"" #bcchfrequency" ""

    Range("A6"). Select

    Selection.Copy

    Range("A12") .Select

    ActiveSheet. Paste

    Application. CutCopyMode = False

    ActiveCell.FormulaR 1C1 = "= input!R[-9]C[ 6]&"" #lac"""

    Range("A7"). Select

    Selection.Copy

    Range("A13") .Select

    ActiveSheet. Paste

    Application. CutCopyMode = False

    ActiveCell.FormulaR 1C1 = "= ""cr RncFunction= 1,ExternalGsmNet 
work=1,ExternalG smCell="" &input!R[ -9]C[1]"

    Range("A8"). Select

    Selection.Copy

    Range("A14") .Select

    ActiveSheet. Paste

    Application. CutCopyMode = False

    ActiveCell.FormulaR 1C1 = "= input!R[-10] C&"" #cell id"""

    Range("A9"). Select

    Selection.Copy

    Range("A15") .Select

    ActiveSheet. Paste

    Application. CutCopyMode = False

    ActiveCell.FormulaR 1C1 = "= input!R[-11] C[3]&"" #ncc"""

    Range("A10") .Select

    Selection.Copy

    Range("A16") .Select

    ActiveSheet. Paste

    Application. CutCopyMode = False

    ActiveCell.FormulaR 1C1 = "= input!R[-12] C[4]&"" #bcc"""

    Range("A11") .Select

    Selection.Copy

    Range("A17") .Select

    ActiveSheet. Paste

    Application. CutCopyMode = False

    ActiveCell.FormulaR 1C1 = "= input!R[-13] C[5]&"" #bcchfrequency" ""

    Range("A12") .Select

    Selection.Copy

    Range("A18") .Select

    ActiveSheet. Paste

    Application. CutCopyMode = False

    ActiveCell.FormulaR 1C1 = "= input!R[-14] C[6]&"" #lac"""



dst.. sampai .. End Sub



.... saya mencoba untuk menganti dengan looping tetapi selalu gagal.. 



terima kasih buat RR yg bisa kasih masukan biar data yg di olah menjadi 
variabel dan juga macronya sendiri lebih dinamis.



Salam



Lepi





    
     

    
    


 



  






      

Kirim email ke