Sub week()
a = 0
b = 0
Application.ScreenUpdating = False
For a = 0 To 7
Sheets("Totaal").Select
If ActiveCell.Offset(b, 0) = "" Then
a = a - 1
Else
g = ActiveCell.Offset(b, -4).Address
Sheets("Weekomzet").Select
ActiveCell.Offset(0, a) = "=totaal!" & g
ActiveCell.Offset(0, a).NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)"
ActiveCell.Offset(0, a).Replace What:="$", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
End If
b = b + 1
Next a
Application.ScreenUpdating = True
End Sub
Dit geeft als resultaat: =Totaal!E3
maar ik wil graag: =ALS(Totaal!E3>0;Totaal!E3;"")
a = 0
b = 0
Application.ScreenUpdating = False
For a = 0 To 7
Sheets("Totaal").Select
If ActiveCell.Offset(b, 0) = "" Then
a = a - 1
Else
g = ActiveCell.Offset(b, -4).Address
Sheets("Weekomzet").Select
ActiveCell.Offset(0, a) = "=totaal!" & g
ActiveCell.Offset(0, a).NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)"
ActiveCell.Offset(0, a).Replace What:="$", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
End If
b = b + 1
Next a
Application.ScreenUpdating = True
End Sub
Dit geeft als resultaat: =Totaal!E3
maar ik wil graag: =ALS(Totaal!E3>0;Totaal!E3;"")
Bijlagen
Laatst bewerkt: