Wim Geuens
Member
Hi,
Can someone please tell me how I can put a formula in an active cell
here is a part of the code, but it doesn't work and gives me an error
Thansk for your help
W
Can someone please tell me how I can put a formula in an active cell
here is a part of the code, but it doesn't work and gives me an error
Thansk for your help
W
Code:
ActiveCell.Offset(0, 1).Select
rng1 = ActiveCell.Address(False, False)
Col = Left(rng1, Len(rng1) - Len(Format(rng.Row, "0")))
ActiveCell.Offset(0, 2).Select
rng2 = ActiveCell.Address(False, False)
lCol = Left(rng2, Len(rng2) - Len(Format(rng.Row, "0")))
ActiveCell.Offset(39, 0).Select
ActiveCell.Formula = "=(106-SUM(" & Col & "6;" & lCol & "6;" & Col & "10;" & lCol & "10;" & Col & "18;" & lCol & "18;" & Col & "22;" & lCol & "22;" & Col & "32)+((" & Col & "8+" & lCol & "8)/2))"
ActiveSheet.Calculate
Uren = ActiveCell.Copy