obrázok
Veď to ide. Len potom sa bude spúšťať každé makro aj to, ktoré nebudeš chcieť. Teda nebudeš mať žiadnu ochranu pred vírusmi.
Karta vývojár -> zabezpečenie makra.
Tu je súbor
Do bunky C2 daj vzorec
=(B2-A2)*1440-SUMPRODUCT(($E$2:$E$5>=A2)*($G$2:$G$5<=B2)*($G$2:$G$5-$E$2:$E$5)*1440)
a skopíruj po C8
Neuvažujem s tým, že odíde počas prestávky.
1440=24*60
SUMPRODUCT je myslím SKALARNI.SOUCIN
Sub Makro1()
Set ws = Sheets("Effectifs")
For i = 1 To 3
heslo = InputBox("Heslo")
If heslo = "Heslo123" Then
ws.Visible = 1 - ws.Visible
Exit Sub
End If
Next i
Application.DisplayAlerts = False
Application.Quit
End Sub
Asi takto?
Sub Makro2()
textstr = "C2=A2+B2"
ActiveCell.FormulaR1C1 = textstr
ActiveCell.Characters(Start:=1, Length:=Len(textstr)).Font.Superscript = False
ActiveCell.Characters(Start:=2, Length:=1).Font.Superscript = True
ActiveCell.Characters(Start:=5, Length:=1).Font.Superscript = True
ActiveCell.Characters(Start:=8, Length:=1).Font.Superscript = True
End Sub
Oblíbený formulář Faktura byl vylepšen a rozšířen.
Více se dočtete zde.