Hello all. I need to link cells in a sheet with a name provided by the user "shtName", to a cell in row Q on sheet "SNSs". I have used:
Range("Q9").Formula = "='" & shtName & "'!B60"
to link cells that are in static rows, but in this case the rows on the SNSs sheet will be variable. The process is that when the frmScoutEntry is run, the user enters scout information and the applicable sheet and entries are made on other sheets. When the new scout name is created on the SNSs sheet, I need the cell Q9 to be linked to B60 on the newly created sheet (the name is held in the variable shtName). The next time the code is run, a new scout will be added to the SNSs sheet so the previous scout linked cell is now Q11. The value in still needs to remain linked to the previously added scout.
I thought perhaps an IF statement in the code could match the scout names on the SNSs and scout-named sheets and link the applicable cell in Q to the scout sheet B60 but I have never been good with IF statements:
If Sheets("SNSs").Range("A:A") = shtName.Range("$A$2" & " " & "$A$3") Then
shtName.Range("B60")=Sheets("SNSs").Range.offset()16
Any help would be appreciated.
Thanks,
Andrew
Bookmarks