Results 1 to 5 of 5

Link cell from variable named sheet to cell on another sheet with variable rows

Threaded View

drewship Link cell from variable named... 12-06-2010, 10:19 AM
drewship Re: Link cell from variable... 12-07-2010, 11:25 AM
StephenR Re: Link cell from variable... 12-07-2010, 12:24 PM
drewship Re: Link cell from variable... 12-07-2010, 01:05 PM
drewship Re: Link cell from variable... 12-07-2010, 01:38 PM
  1. #1
    Forum Contributor
    Join Date
    04-30-2009
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    496

    Link cell from variable named sheet to cell on another sheet with variable rows

    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
    Attached Files Attached Files
    Last edited by drewship; 12-08-2010 at 08:57 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1