[ culmilan @ 20.02.2013. 09:10 ] @
Kako i šta sve treba da promjenim u ovom macrou da bi on bio Sub Bruto() da ga mogu pokretati tastaturom i da ispravno radi.Unapred hvala svima koji su spremni pomoći. Code: Sub Bruto(ByVal control As IRibbonControl) ' ' Program za izradu bruto stanja ' Sheets("BRUTO").Select oldStatusBar = Application.DisplayStatusBar Application.DisplayStatusBar = True Application.StatusBar = "Bruto" Range("Q14") = "Sifra" Range("P18") = "Sifra" Range("Q18") = "Sifra" Range("Q15") = "_KK*" Range("Q19").Select Selection.ListNames Selection.End(xlDown).Select Red = Selection.Row Range(Cells(18, 17), Cells(Red, 17)).AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range _ ("Q14:Q15"), CopyToRange:=Range("P18"), Unique:=False Range("P18").Select Selection.End(xlDown).Select Red = Selection.Row If Red > 50000 Then End Range(Cells(21, 1), Cells(21 + 5, 7)).Select Selection.Cut Cells(Red + 1, 1).Select ActiveSheet.Paste Range(Cells(20, 1), Cells(20, 7)).Select Application.CutCopyMode = False Selection.Copy Range(Cells(20, 1), Cells(Red, 7)).Select ActiveSheet.Paste For Q29 = 19 To Red Application.StatusBar = "Cita " & Q29 Konto = Cells(Q29, 16) Cells(Q29, 4) = Range(Konto).Cells(2, 5) Cells(Q29, 5) = Range(Konto).Cells(2, 6) Next Q29 Application.StatusBar = "Bruto" Range(Cells(19, 1), Cells(Red + 2, 7)).Select Selection.Copy Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False For AZ1 = 1 To 10 Range("BB26") = "" & AZ1 - 1 & "*" Range(Cells(7, 1), Cells(Red, 5)).AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _ "BB25:BB26"), CopyToRange:=Range("BB28:BD28"), Unique:=False Cells(AZ1 + 7, 4) = Range("BC26") Cells(AZ1 + 7, 5) = Range("BD26") Next AZ1 Q29 = 18 2 Q29 = Q29 + 1 3 If Q29 > Red Then GoTo 1 Application.StatusBar = "Sredjuje " & Q29 If Cells(Q29 + 1, 1) = Cells(Q29, 1) Then Sabiraj GoTo 3 End If GoTo 2 Application.StatusBar = "Bruto" Q29 = 19 4 Ubacivanje If Q29 <= Red Then GoTo 4 End Sub [Mod: TAGovi] [Ovu poruku je menjao 3okc dana 20.02.2013. u 11:05 GMT+1] |