wongsh
07-27-2016, 07:59 AM
Hi,
I am trying to write a script to input a fomula into a cell, with a known cell multiplying by an unknown cell.
The unknown cell's location varies with the length of the set of data. E.g. if there are 10 rows in the data set, the unknown cell will be on row 12, and with 15 rows data the unknown cell will be on row 17 etc. Anyone can help me on that? Thanks!
Dim Ttl As String
Range("E2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 2).Select
ActiveCell.Select
Ttl = ActiveCell
Range("F3").Formula = "+E3*" & Ttl
I am trying to write a script to input a fomula into a cell, with a known cell multiplying by an unknown cell.
The unknown cell's location varies with the length of the set of data. E.g. if there are 10 rows in the data set, the unknown cell will be on row 12, and with 15 rows data the unknown cell will be on row 17 etc. Anyone can help me on that? Thanks!
Dim Ttl As String
Range("E2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 2).Select
ActiveCell.Select
Ttl = ActiveCell
Range("F3").Formula = "+E3*" & Ttl