Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All
I have adapted the code below off info gleaned on this forum and it works OK , however a question was asked of me what would happen if I was on Holiday or absent through sickness etc - how would we change the values listed below. Private Sub Add100_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("Customers Prices") Worksheets("Customers Prices").Select Range("A3").Select Tb100.Value = Application.CountIf(Range("J3:J600"), "30") Tb101.Value = Tb100.Value * 30 Tb102.Value = Application.CountIf(Range("J3:J600"), "15") Tb103.Value = Tb102.Value * 15 Tb106.Value = Application.CountIf(Range("J3:J600"), "13") Tb107.Value = Tb106.Value * 13 Tb108.Value = Application.CountIf(Range("J3:J600"), "10") Tb109.Value = Tb108.Value * 10 Tb110.Value = Application.CountIf(Range("J3:J600"), "5") Tb111.Value = Tb110.Value * 5 Tb112.Value = Application.CountIf(Range("J3:J452"), "CAR*") Tb114.Value = Application.CountIf(Range("J3:J452"), "FREE*") Tb104.Value = (Val(Trim(Tb100.Value))) + (Val(Trim(Tb102.Value))) + (Val(Trim(Tb106.Value))) + (Val(Trim(Tb108.Value))) + (Val(Trim(Tb110.Value))) + (Val(Trim(Tb112.Value))) + (Val(Trim(Tb114.Value))) Tb105.Value = (Val(Trim(Tb101.Value))) + (Val(Trim(Tb103.Value))) + (Val(Trim(Tb107.Value))) + (Val(Trim(Tb109.Value))) + (Val(Trim(Tb111.Value))) Tb105.Value = FormatCurrency(Tb105.Value, 2) Tb103.Value = FormatCurrency(Tb103.Value, 2) Tb101.Value = FormatCurrency(Tb101.Value, 2) Tb107.Value = FormatCurrency(Tb107.Value, 2) Tb109.Value = FormatCurrency(Tb109.Value, 2) Tb111.Value = FormatCurrency(Tb111.Value, 2) End Sub Any help or suggestions most helpful?? -- Many thanks hazel |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Changing values by a % | Excel Worksheet Functions | |||
changing values | Excel Discussion (Misc queries) | |||
changing values in one column based on values in another? | Excel Programming | |||
Changing Cell Values | Excel Programming | |||
Changing values in formulas with VBA | Excel Programming |