My macro opens a couple of different workbooks and enters a formula or two just to collect the results and use them in the workbook where the macro resides. Below is one of them.
How can I eliminate the Range().Formula for the above? I don't know how to word this, but I'd like to (put/calculate?) the data right in the variable, something like this:
Code:
Windows("1.10.2.2.xls").Activate
Range("K22").Formula = "=MAX(E4:E" & NoOfRowsA & ")"
Range("L22").Formula = "=VLOOKUP(K22,E4:I" & NoOfRowsA & ",5,0)"
CurrCost = Range("L22").Value
CurrDate = Range("K22").Value
How can I eliminate the Range().Formula for the above? I don't know how to word this, but I'd like to (put/calculate?) the data right in the variable, something like this:
Code:
CurrCost = "=VLOOKUP(K22,E4:I" & NoOfRowsA & ",5,0)"
CurrDate = "=MAX(E4:E" & NoOfRowsA & ")"