tf37
Board Regular
- Joined
- Apr 16, 2004
- Messages
- 169
Is it possible to have a cell formula change based on another cells value?
I have a macro that does what I’m after, but I’d have to recreate another 128 times for each row. Can it be done where it runs a function, or on cell exit - the cell that contains the text word(s), but then copy that and just paste it into the other row cell and it knows it is now in cell M6 then M7 etc…like creating formulas and copy and pasting in another cell, it knows the range has changed...hope that makes sense - thank you gang
Macro:
Sub RateCalInOutParalegal()
'
' RateCalInOutParalegal Macro
'
Range("M5").Select
If Range("m5") = "out" Then
Range("L5") = ("=j5*40")
ElseIf Range("m5") = "in" Then
Range("L5") = ("=j5*60")
ElseIf Range("m5") = "paralegal" Then
Range("L5") = ("=j5*20")
End If
End Sub
I have a macro that does what I’m after, but I’d have to recreate another 128 times for each row. Can it be done where it runs a function, or on cell exit - the cell that contains the text word(s), but then copy that and just paste it into the other row cell and it knows it is now in cell M6 then M7 etc…like creating formulas and copy and pasting in another cell, it knows the range has changed...hope that makes sense - thank you gang
Macro:
Sub RateCalInOutParalegal()
'
' RateCalInOutParalegal Macro
'
Range("M5").Select
If Range("m5") = "out" Then
Range("L5") = ("=j5*40")
ElseIf Range("m5") = "in" Then
Range("L5") = ("=j5*60")
ElseIf Range("m5") = "paralegal" Then
Range("L5") = ("=j5*20")
End If
End Sub