+ Reply to Thread
Results 1 to 4 of 4

Can't add formula linking cell to matching entry in other sheet with variable name

  1. #1
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Can't add formula linking cell to matching entry in other sheet with variable name

    Apologies if this reads as complicated as I fear!

    Can't work out the correct formula to find the matching cell on a worksheet with a variable name matching cell on another sheet with a variable name.

    Please Login or Register  to view this content.
    Sure it'll be a simple error, but spent all day trying numerous permutations and failing.

    All solutions, suggestions and alternatives welcome as ever

    Ochimus
    Last edited by Ochimus; 12-12-2019 at 03:17 PM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,791

    Re: Can't add formula linking cell to matching entry in other sheet with variable name

    As you are writing a formula which include a sheet reference and the sheet name includes spaces, then you need to enclose the full sheet name within apostrophes, so this line would become:

    Please Login or Register  to view this content.
    Hope this helps.

    Pete

    EDIT: hope you can see those two red apostrophes.

    Pete

  3. #3
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Can't add formula linking cell to matching entry in other sheet with variable name

    Sorry, the apostrophes haven't solved it. Line throws a RunTime Error 13 Type Mismatch:

    Please Login or Register  to view this content.

    Galling to be so near, yet so far. . .

    Ochimus
    Last edited by Ochimus; 12-13-2019 at 08:07 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Can't add formula linking cell to matching entry in other sheet with variable name

    SOLVED. And a salutory lesson to even the experienced amongst us.

    ws3.Cells(z, 10).Formula = "='payroll totals " & ws.Cells(2, 1) & "'!" & .Cells(Found.Rows, 10).Address(0, 0)

    Fails.

    ws3.Cells(z, 10).Formula = "='payroll totals " & ws.Cells(2, 1) & "'!" & .Cells(Found.Row, 10).Address(0, 0)

    Drop the plural and works perfectly. Would have saved me days if Excel Help had pointed that out instead of the generic Error message?

    Ochimus

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Linking a text box on one sheet to a variable cell on another sheet in same workbook
    By Grilleman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2019, 05:32 AM
  2. [SOLVED] Userform for date entry and then copy/paste matching data to another sheet
    By nymanns in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-06-2013, 03:22 AM
  3. Help linking variable cells to a master sheet
    By amyclough in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-13-2013, 06:10 PM
  4. Linking formula or cell from one sheet to another??
    By kittykatoo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-19-2012, 02:19 PM
  5. [SOLVED] for each sheet with first 3 char matching variable, copy column C to Target sheet unless..
    By Spyderz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-11-2012, 08:17 AM
  6. Linking Cells to Allow Data Entry in Either Cell
    By Muttling in forum Excel General
    Replies: 4
    Last Post: 07-08-2010, 04:44 AM
  7. My formula cell linking to other sheet is not valid?
    By FRUITO in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-14-2009, 10:44 PM

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