Excel shape in cell

Содержание

  1. SHAPE, inserted in the cell, hinders cell selection
  2. 2 Answers 2
  3. Link cell with Excel Shape
  4. 2 Answers 2
  5. Linked
  6. Related
  7. Hot Network Questions
  8. Subscribe to RSS
  9. How to Connect a Shape or WordArt to an Excel Cell
  10. Insert WordArt in Excel
  11. Modify a WordArt
  12. Insert Shape in Excel
  13. How to Make a Circle Around Something in Excel & Google Sheets
  14. Make a Circle Around a Cell
  15. Copy a Circle
  16. Make a Circle Around a Cell in Google Sheets
  17. Conditional Formatting Shapes
  18. Using Linked Pictures
  19. Let’s see step by step how to create it:
  20. Can Conditional Formatting control shapes?
  21. Apply an Automated VBA Solution
  22. Conditional Formatting shapes: Improve your Excel skills
  23. Additional resources

SHAPE, inserted in the cell, hinders cell selection

I have a code that inserts a shape in the cell.

Suppose I insert shape in cell A1 and would like to write in that cell «5».

After the shape is inserted, the cell on-mouse-over cannot be selected because the shape is overlapping with it. I can only select the shape. Or, if I make shape unselectable, I cannot select neither shape, nor cell.

In order to write «5» in A1, I have to select e.g. cell B1 and with keyboard arrow Follow

2 Answers 2

In case you do only need to select specific cells, you can define the cells to be editable like below. Afterwards you protect the sheet and allow solely to select locked and/or unlocked cells. Do let me know if you require a programmatic solution to this as well.

To my knowledge, you cannot create a shape «behind» a cell. However, what you can do is trigger an event every time the shape is selected. This event can be set to select the cell behind the shape. One implementation of this can be found in this answer. (Additional knowledge here).

Add the following sub to your code:

This procedure will simply select a specified cell on a specified sheet. We can set a shape to run this macro using .OnAction . We just have to tell the shape to run the SelectCell macro with our desired parameters (Sheet name, and cell address). To pass the parameters of your specified cell to the shape add the following code: (I am assuming that ActWS is your active worksheet)

Now every time you click the circle, the circle will click the cell behind the circle, effectively allowing you to bypass the circle selection.

Источник

Link cell with Excel Shape

In excel, we insert a shape, and we can link it to a cells value, by selecting shape and typing the cell reference in formula bar. I want to know: How can we do that programmatically. Like

Here is what I want to do programmatically

It’s been days now , I am searching it. Really Need help, Thanks Alot.

2 Answers 2

You don’t need to use Select to apply formulas to Shapes. Select should be avoided wherever possible as it bloats code, and can have unintended consequences — for example triggering Events

Instead you can work with the Formula directly by using DrawingOBject, see FormApp which also will let you manipulate existing formula (ie add 6 cell to A2 to make it A8, A12 to A18 etc). The second code routine FormAdd makes this adjustment, it works on both cell addresses and range names

The simplest option is to programatically select the shape first, then apply the formula

Or course this will error if a shape on the sheet does not support the .Formula property

Linked

Hot Network Questions

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.3.20.43331

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

How to Connect a Shape or WordArt to an Excel Cell

Insert WordArt in Excel

To use the WordArt in Excel, follow these steps:

  1. Go to the Insert tab from the ribbon.
  2. Click on the Text button, and select the WordArt, then choose one of the styles.
  3. Delete the text in the word art.
  4. Type ‘=’ in the Formula Bar.
  5. Select the cell where you want to see the result and press “Enter.”
  6. Now whatever you type in the cell, you will see in Shape or WordArt styles.

Picture 1- How to add a WordArt in Excel

Modify a WordArt

When you add a word art, a new tab opens on the ribbon, which is called the Format tab. This tab contains these groups of tools:

  • Insert Shapes (we’ll explain in the Insert shape part.)
  • Shape Styles
    • Quickly add visual styles.
    • Change the color by the Shape Fill and the Shape Outline options.
    • Change the effects such as shadow, reflection, etc. by the Shape Effects option.
  • Wordart Styles
    • Add some artistic flair by choosing between predefined text styles.
    • Change the color by the Text Fill and the Text Outline options.
    • Change the Effects such as shadow, reflection, etc. by the Text Effects option.
  • Arrange
    • Bring the objects forward or send them backward by the Bring Forward and the Send backward options.
    • The Selection Pane helps you see all of your objects on a list and select them or edit them quickly.
    • The Align option helps to change the placement of the objects.
    • The Align option helps to change the placement of the objects.
    • The Rotate option rotates or flips the objects.
  • Size
    • Change the height or width of the objects by the Shape Height and the Shape Width options.

Insert Shape in Excel

A way to add shapes to an Excel worksheet is:

  1. Go to the Insert tab.
  2. From the Illustration section, click on the Shape button .
  3. Now select the shape you want.

Picture 2- How to insert a shape in Excel

If you added a word art and want to insert a shape to the worksheet too, follow these steps:

  1. In the Format tab from the Drawing Tools, go to the Insert Shapes group.
  2. Pick one of the shapes from the ready-shapes list.

Picture 3- How to add a shape in Excel

You can edit the shapes by the Edit Shape option, such as edit points or reroute connectors. Also, you can add text boxes to your shapes by the Text Box .

Looking for visualizing your Excel reports? Please contact us through the Excel visualization services page.

Источник

How to Make a Circle Around Something in Excel & Google Sheets

In this article, you will learn how to make a circle around something in Excel and Google Sheets.

Make a Circle Around a Cell

In Excel, you can circle a cell using the oval shape. Say you have the following list of names in Column B:

You can circle, for example, Michael in cell B5 with a red oval.

1. In the Ribbon, go to Insert > Shapes > Basic Shapes > Oval. Here you can choose to insert any shape offered (rectangle, circle, etc.). Any shape that you insert will be added to the Recently Used Shapes section at the top.

2. A small black cross appears. Position it where you want to start the shape and drag the cursor to form the shape.

As a result of this step, the oval is inserted, but as you can see below, the fill color and line color are both blue. The shape needs to have a red line and transparent fill, so you can see the text from the cell underneath.

3. To change the oval’s appearance, right-click on the shape and choose Format Shape.

4. The Format Shape menu comes up on the right side of the screen. (1) Click Fill, and (2) set the transparency to 100% (this removes the fill color of the shape). Then (3) click Line, and (4) choose the line color (red).

Finally, the shape is transparent with the red outline, and the text in B5 is circled. Similarly, you can also circle a range of cells by expanding the shape.

Another option to format the shape is to use the options in the Ribbon. To do this, click on the shape to select it, and in the Ribbon, go to Format Shape > Shape Fill (and Shape Outline).

Note: You can also insert a shape using VBA code.

Copy a Circle

Now let’s say you want to circle another name (for example, Jennifer) with the same shape (transparent with a red outline). To avoid formatting a new shape, you can copy the existing one and position it around cell B10.

1. Right-click the shape, and choose Copy (or use the keyboard shortcut CTRL + C).

2. Right-click the cell where you want to paste the shape (B10), and choose Paste (Keep source formatting, or use the keyboard shortcut CTRL + V).

3. Now the shape is in the right general area, but it is not positioned ideally around the text in the cell. Therefore, you have to move it a bit. To do this, position the cursor on the shape, and when the four-sided arrow appears, drag and drop the shape.

As a result, you have a new shape copied from the original one.

Make a Circle Around a Cell in Google Sheets

You can also add a shape to circle a cell in Google Sheets.

1. Select a cell where you want to add a circle (B5) and in the menu, go to Insert > Drawing.

2. In the Drawing window, (1) click the shape icon, then (2) select Shapes and (3) choose a shape (e.g., Rounded Rectangle).

3. A black cross appears. Position it where you want to start your shape and drag the cursor to form the shape.

4. Click the fill color icon, and choose Transparent.

5. Click the border color icon, and select the color (red).

6. Now that the shape is created, and click Save and Close.

7. The shape is now inserted into the sheet, but not in the right place. Select the shape and position the cursor on it until the white hand appears. Now, drag and drop the shape to position it around cell B5 (Michael).

Finally, you have the red shape around the text.

Unfortunately, in Google Sheets, you can’t copy a drawing, so if you need several shapes, you’ll need to create them manually one by one.

Источник

Conditional Formatting Shapes

Conditional formatting shapes and cells! This is an exciting area in Excel. This tutorial will show you how to use conditional formatting to create live shapes using various techniques.

We will show you all the tricks related to this subject. You can create dynamic presentations using this Excel feature. We provide free downloadable spreadsheets and examples. Let’s start reading!

Formatting cells is a useful function.

Can this function be extended?

Is a shape fit to be the highlighted element of an excel dashboard?

Of course! Stay with us today, and we’ll show you how all this is possible.

Using Linked Pictures

It may appear that conditional formatting in Excel only works with cells. But what if we would like to use formulas?

There’s no problem. Let’s use the simplest and most obvious solution. This is the linked picture method.

Let’s see step by step how to create it:

First, select an already formatted cell.

In the picture below, we have created a little example of this. We will pay attention to the range D5:D6.

You can see the rules in the Rules Manager window. We didn’t make it overly complicated. If the cell value is larger or equal to 2, it will color red.

If the cell value is smaller than 2, it will color green.

Copy the cells containing the conditional Formatting as a linked picture.

We can use the Home tab on the ribbon, but it is easier to use the right-click menu.

The linked picture acts as a graphical object. So, for example, we can move or resize it.

Enter 1 in both cells.

As an effect of the conditional formatting, both cells will turn green, so the rule we have set before will prevail.

We can control the shape with the change in the cell’s value.

This was, in any case, the simplest solution for the use of Conditional Formatting on a shape.

Don’t forget that now we are talking about a simple picture.

Can Conditional Formatting control shapes?

The answer is yes! And with an easy way. Some people like to overcomplicate VBA programming. There’s no need for that.

Following the tutorial furthermore, we’ll introduce two more methods.

Now we’d like to color a real Shape with the help of conditional formatting. The first thing that comes to mind is to write a short VBA code.

The colors of the shapes are very easily controlled with the help of Visual Basic.

Insert a simple object.

We would like if the object’s color would change based on the cell’s value.

If the cell contains the word “RED,” the VBA code will color the circle red. The same principle will also be true for the “YELLOW” and “GREEN” variants. We start from the desire that we don’t want manually run any code or assign it to buttons. Instead, start the code with the event of Private Sub Worksheet_Change (ByVal Target As Range).

This event ensures that a little VBA program will run if anything changes on the worksheet.

The explanation for the VBA codes:

If the value of the C8 cell = “RED” will highlight the shape Shape1 that can be found on the active worksheet, it changes its color to red. In other cases (for example, if the C8 cell doesn’t contain the word “RED”), it will do the following.

If the text is = “YELLOW” it will color the object yellow.
And if the C8 cell contains the word “GREEN”, it will color it green.

We are done with this.

It’s not very hard to create this code.

We don’t need at all advanced knowledge of VBA.
In a matter of moments, we can find the name and the changed color code with macro recording.

Apply an Automated VBA Solution

Finally, we introduce a solution we recommend to everyone creating an excel dashboard using conditional formatting.

VBA development is not always a grateful thing, but it’s time to announce the good news proudly. This macro is little but a very well applicable solution.

This small Excel file finally bridges over Excel’s sometimes extremely frustrating limitations.

With the help of the conditional formatting shapes method, we again will push the limits of Excel.

Before we get into the middle of it, we’ll show the result.

As you can see in the picture above, the shape’s color depends on the given value in the cell. Therefore, it will change dynamically depending on the size of the values.

Now, in brief, we demonstrate how to use the template:

1. Insert a shape on any given worksheet.

2. We choose the oval object:

3. In the Name Box, change the default name to any given name:

Why is this important? We store the values and colors that make the object dynamic on the setup sheet. We give every object a specific name and can easily identify them.

4. Let’s take a look at the setup worksheet!

The meaning of the columns:

Column A: This is an ID, don’t carry any importance; we can write anything here.
Column B: the name of the object. This must be the same one we wrote in the Name Box a minute ago.

The Upper Limit is the number above which the shape’s color turns green (Color1).
The Lower Limit is the number below which the shape turns red (Color3).

Between the upper and lower limits, the shape’s color will be yellow (Color2).

5. The colors can be arbitrarily changed.
6. Actual Value: doesn’t need any explanation. It is the current value.

7. Let’s go back to Sheet1.

Highlight the object, and in the Formula Bar field, type in the following:

This will set the current value to 45. Then, based on the table, the shape will change its color to yellow because this value is between the upper and the lower value range.

We can freely insert newer rows, and you can automatically command more shapes at any time.

You can create great-looking widgets and variance charts in minutes!

Conditional Formatting shapes: Improve your Excel skills

In conclusion, we can say that conditional formatting shapes can do way more things than most of us think. You can find the VBA code on the sample workbook, which you can freely use and modify.

There are many possibilities in Excel. We’ll try to introduce as many of them as possible. See you next week! The macro-enabled worksheet can be downloaded from here!

Additional resources

  • How to create a rollover hyperlink effect in Excel?
  • Group and align shapes

Ultimate Dashboard Tools

Pro Dashboard Add-in for Excel. Fully automated. Lightweight. No coding skills required.

Project Management Toolkit

Источник

Is it possible to fill a cell within a range (A1:H4) with a rectangle shape so that the entire cell is filled and when the range is sorted the rectangle shape stays with the cell it was placed into?

Original range with 3 shapes added for Washington and Roosevelt

enter image description here

After sorting on Name column this happens:

enter image description here

Is it possible to tie a shape to a particular cell?

EDIT: It appears if the shape fits within the size of the cell, then it ‘stays’ with the cell when the range is sorted?

asked Mar 12, 2021 at 20:05

Joth's user avatar

JothJoth

1551 gold badge2 silver badges10 bronze badges

If you sort across multiple columns using SORT() or using data->sort on the ribbon, it will keep the rows in tact and your colors will stay where they are. For example:

=SORT(A2:AH4)

will sort those 3 rows in ID# order and keep your colors with each row as it moves.

answered Mar 12, 2021 at 21:02

David Richardson's user avatar

4

answered Mar 12, 2021 at 22:29

Joth's user avatar

JothJoth

1551 gold badge2 silver badges10 bronze badges


  • Hajir H


  • November 9, 2015


  • No Comments

Insert WordArt in Excel

To use the WordArt in Excel, follow these steps:

  1. Go to the Insert tab from the ribbon.
  2. Click on the Text button, and select the WordArt, then choose one of the styles.
  3. Delete the text in the word art.
  4. Type ‘=’ in the Formula Bar.
  5. Select the cell where you want to see the result and press “Enter.”
  6. Now whatever you type in the cell, you will see in Shape or WordArt styles.

How to add a word art in Excel 2016?

Picture 1- How to add a WordArt in Excel

As you see, it’s bSuperior System!

Modify a WordArt

When you add a word art, a new tab opens on the ribbon, which is called the Format tab. This tab contains these groups of tools:

  • Insert Shapes (we’ll explain in the Insert shape part.)
  • Shape Styles
  • Wordart Styles
  • Arrange
  • Size

Insert Shape in Excel

A way to add shapes to an Excel worksheet is:

  1. Go to the Insert tab.
  2. From the Illustration section, click on the Shape button.
  3. Now select the shape you want.

How to add a shape to an Excel worksheet by the Illustrations tool.

Picture 2- How to insert a shape in Excel

If you added a word art and want to insert a shape to the worksheet too, follow these steps:

  1. In the Format tab from the Drawing Tools, go to the Insert Shapes group.
  2. Pick one of the shapes from the ready-shapes list.

Adding a shape in Excel 2016 by the Drawing Tool.

Picture 3- How to add a shape in Excel

You can edit the shapes by the Edit Shape option, such as edit points or reroute connectors. Also, you can add text boxes to your shapes by the Text Box.

Looking for visualizing your Excel reports? Please contact us through the Excel visualization services page.

Subscribe to our Newsletter

Share this post with your friends

Leave a Reply

If you are creating a chart or diagram in Excel with shapes, you might need to update the shape text
automatically depending on the value in a particular cell.

Shape with cell information Excel 2016

To insert the cell content to your shape, do the following:

   1.   Select the shape or text box.

   2.   In the formula bar, type the equal («=«) symbol.

   3.   Click the spreadsheet cell that contains the data or text you want to
insert into the selected shape or text box.

You can also type the reference to the spreadsheet cell. Include the sheet name, for example:

= [officetooltips.xls]Tips!$B$2

   4.   Press Enter.

See also this tip in French:
Comment insérer le contenu de la cellule à la forme.

Please, disable AdBlock and reload the page to continue

Today, 30% of our visitors use Ad-Block to block ads.We understand your pain with ads, but without ads, we won’t be able to provide you with free content soon. If you need our content for work or study, please support our efforts and disable AdBlock for our site. As you will see, we have a lot of helpful information to share.

  • #2

On your Drawing toolbar, goto Draw. There are many options for aligning autoshapes in there.

  • #3

Objects in XL do not fit into a cell; instead, they ‘float’ in a layer above the cells layer. Consequently, it is not possible — without an incredible amount of work — to make an object appear as though it is part of the text within a cell.

That said, XL does support some rudimentary shape position and size relative to the underlying cell. Double click the object and select the Properties tab.

gnaga said:

I would like to draw a shape (for ex. Smily Face) in a cell and want to align with the cell like formating a text in the cell. Horizontally and vertically center and if cell changes this (shape) also shoud get adjust it to the cell size. Is this possible?

  • #4

Thanks for both of you.

In Draw option in the drawing toolbar has some options for aligning the shape but it is not gettting enabled even I select the shape object. I do not know how to make them enable.

Tushar, If I copy & paste an exisiting shape, it is not getting pasted into my deisred location but close to the copied shape. How to move this shape object into a desired location in the worksheet?

  • #5

For a shape taken created by using the Excel Drawing toolbar, or for an image or picture that has been pasted, click on top of the shape or picture. You should see the eight little sizing squares, and the cursor turns into a four-arrow shape. Just click and hold down the left mouse button, and drag the shape where you want it, then, release the mouse button. That’s it!

  • #6

Ralph Thanks. I am aware of the technique you have suggested. I wanted to copy the shape or image and then I want to paste it in a location thorugh VBA. Is the worksheet has any dimension based on pixels to place the image into a particular location?

  • #7

Code:

Sub testIt()
    With ActiveSheet.Shapes(1)
    .Height = .Height / 2
    .Width = .Width / 2
    .Left = Range("c1").Left
    .Top = Range("c1").Top
        End With
    End Sub

  • #8

Tushar Thank you very much. This is the one I was looking for. Now I can manipulate with this to complete my work.

  • #9

Code:

Sub testIt()
    With ActiveSheet.Shapes(1)
    .Height = .Height / 2
    .Width = .Width / 2
    .Left = Range("c1").Left
    .Top = Range("c1").Top
        End With
    End Sub

Perfect! this is also just what I needed, Tusharm, thank you!

Like this post? Please share to your friends:
  • Excel return the value of a cell
  • Excel saveas excel save
  • Excel return sheet name
  • Excel save this world
  • Excel return array from function