Help with an Excel Macro
I'm new to programming and I'm stuck...
Here's what I'm trying to do:
I'm using the Days360() formula to populate a time interval in column
6, in column 7 I'm using this formula to calculate a dollar value:
=IF(B3="Data1",ROUND(F3/30,2)*15,IF(B3="Data2",ROUND(F3/30,2)*11.5,IF(B3="Data3",ROUND(F3/30,2)*14,"")))
I'm trying to create a macro that will do this b/c my spreadsheet is
already 1MB+.
This is the code I've come up with so far but its probably not right. I
also want the values to populate automatically (without
Worksheet_Change) but I'm not sure how to do that.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim R As Long
R = Target.Row
If Target.Column = 2 Then
Select Case Cells(R, 2)
Case "Data1"
Cells(R, 7) = ???
Case "Data2"
Cells(R, 7) = ???
Case "Data3"
Cells(R, 7) = ???
End Select
End If
End Sub
Thanks in advance.
--
Dan
|