Sub Package()
Dim CalculatedValue
Range("L2").Select
Do
If ActiveCell.Value = "" Then
CalculatedValue = Application.WorksheetFunction.RoundUp(ActiveCell.Offset(0, -1).Value / 1.5, 0) * 1.5
Select Case CalculatedValue
Case 61.5, 63: ActiveCell.Value = 64.5
Case 31.5, 33: ActiveCell.Value = 34.5
Case Else: ActiveCell.Value = CalculatedValue
End Select
End If
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell.Offset(0, -2))
End Sub
dear friends above macro work fine for me.i need to add two conditions to that macro.it's like this.
01.if Column "G" value " TP " & Column "H" value " 150D " then above 1.5 should change to 0.9
CalculatedValue = Application.WorksheetFunction.RoundUp(ActiveCell.Offset(0, -1).Value / .9, 0) * .9
02.if Column "G" value " PP " & Column "H" value " 16/2 " then above 1.5 should change to 1
CalculatedValue = Application.WorksheetFunction.RoundUp(ActiveCell.Offset(0, -1).Value / 1, 0) * 1
Column "G' & column "H" values other than above then 1.5 is correct.
CalculatedValue = Application.WorksheetFunction.RoundUp(ActiveCell.Offset(0, -1).Value / 1.5, 0) * 1.5
pls anybody can help me to do that......
Bookmarks