Question : scale based on date values

For each row I want to multiply all percentages in col B to the last non-blank col  by 123 if the date in col A is < Jan 7, 2003
or else multiply by 456 if the date in col A is < Jan 15, at 14:00
otherwise multiply by 789. I am including test data.

Answer : scale based on date values

There you go, use this code...

Saurabh...

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
Sub mulitplyvalues()
    Dim lrow As Long, dte As Date
    Dim cell As Range

    lrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
    For Each cell In Range("B2:f" & lrow)
        dte = DateValue(Left(Cells(cell.Row, "A").Value, InStr(1, Cells(cell.Row, "a").Value, "-") - 1))

        If Day(dte) < 7 Then

            cell.NumberFormat = "0.00"
            cell.Value = cell.Value * 123
        ElseIf Day(dte) < 15 Then

            cell.NumberFormat = "0.00"
            cell.Value = cell.Value * 456

        Else

            cell.NumberFormat = "0.00"

            cell.Value = cell.Value * 789


        End If

    Next cell
End Sub
Random Solutions  
 
programming4us programming4us