For example, Activesheet.Cells(15, 18).Value = "MSFT", where 18 is column R
I would like to write ActiveSheet.Cells(16, 18).Formula = "=STOCKHISTORY(ActiveSheet.Cells(15, 18).Value,TODAY()-30,TODAY())", something like that, how to write syntax correctly? There is error in my code, it turns out to be =@STOCKHISTORY(@ActiveSheet.Cells(15, 18).Value,TODAY()-30,TODAY()) Actually, I want Cell R16 turn out to be = STOCKHISTORY("MSFT",TODAY()-30,TODAY()), but I cannot use MSFT directly, how to make Activesheet.Cells(15, 18).Value as part of code.
I need to write it in this way, since there are a list of companies, I have to write a VBA loop. Cells(15, 18), Cells(15, 21), Cells(15, 24), Cells(15, 27), ........
To make my question clear: At the end, it should look something similar to attached screenshot, and I would like to write the function =STOCKHISTORY(ActiveSheet.Cells(15, 18).Value,TODAY()-30,TODAY()) in VBA code. How?
Thanks.
Bookmarks