ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Insert Table into Shape (https://www.excelbanter.com/excel-programming/426024-insert-table-into-shape.html)

Paige

Insert Table into Shape
 
Am trying to use code to insert an Excel table into a shape. Both the table
and shape exist in the same workbook; the table is defined by a range name.
Using the following code I can insert the contents of one cell (P47, for
example), but have been unable to figure out how to insert a table based upon
a range name. Can someone advise on this please?

Dim shp As Shape
Dim sText As String
Set shp = ActiveSheet.Shapes("Rectangle 308")
sText = Worksheets("Tables for Pop-Ups").Range("P47").Text
shp.TextFrame.Characters.Text = sText



All times are GMT +1. The time now is 11:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com