Results 1 to 3 of 3

Can't link Shapes to Variable cell references

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365 Version 2501 64-bit
    Posts
    1,465

    Can't link Shapes to Variable cell references

    New data is added each week to the next free row in Cols J - N of the Production worksheet.
    Need Macro to "copy and paste" the latest date and four values to the five Shapes in the Summary worksheet.

    At the moment it generates an "Error Code 91":

    
    Option Explicit
    Dim f As Long
    Dim shp As Shape, shapes As Shape
    Dim wsS As Worksheet, wsG As Worksheet
    
    Sub RESET_GRAPHS()
    
    'Find last row on source sheet
    
        Set wsS = Sheet1
        Set wsG = Sheet2
        
        With wsS
        
        f = .Cells(.Rows.Count, "A").End(xlUp).Row
        If f < 4 Then f = 4
        
        End With
        
        With wsG
    
    'THROWS RUNTIME ERROR 91:
    
        shapes.Range(Array("Rectangle_Rounded_Corners_4")) = wsS.Range("A" & f)
        shapes.Range(Array("Rectangle_Rounded_Corners_3")) = wsS.Range("K" & f)
        shapes.Range(Array("Rectangle_Rounded_Corners_5")) = wsS.Range("L" & f)
        shapes.Range(Array("Rectangle_Rounded_Corners_6")) = wsS.Range("M" & f)
        shapes.Range(Array("Rectangle_Rounded_Corners_7")) = wsS.Range("N" & f)
           
    
        End With
        
    End Sub
    All solutions, suggestions and alternatives welcome as ever.

    Ochimus
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] link combobox to cell and edit references
    By Undo in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 08-29-2021, 09:32 PM
  2. Formula cell needed -> link to variable external link based on a cell content
    By milea_sorin in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-22-2018, 10:00 AM
  3. Shapes.AddPicture, path link in Variable
    By Christiaansd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-22-2016, 08:28 AM
  4. Macro to find and replace specific strings in a cell link by using cell references
    By beginningcoder in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-15-2016, 09:37 PM
  5. [SOLVED] Link to column references from a cell
    By elliotencore in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-12-2013, 10:14 AM
  6. REQUEST: Macro to Link Excel Cell to Shapes
    By MBCMDR in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-29-2011, 05:21 AM
  7. Cell References inside a LINK
    By karaflas01 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-02-2008, 11:03 AM

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