rectangle

  1. Phil Payne

    Changing rectangle shape colour using VBA.

    Hello, i have a worksheet with 6 Rectangles that launch macros. I am tryng to set them up so the user can tell which rectangle was last activated, i.e. change the activated rectangle button colour to say yellow and the others remain or return to a 'default' colour - grey. II achieved this...
  2. P

    Macro Buttons change colour when pressed

    Hi, Looking for a solution to my Macro button (shape) problem. I have the below code which will colour a depressed button. Problem is this will only work for 1 button and i have 12 that i want it to work for. The idea would be that the button stays depressed until another button is selected...
  3. T

    OnAction specifying module

    The code below works perfectly fine: In Module1: Sub a Msgbox "a" Sheet1.Shapes("MyShape").OnAction = "b" End Sub Sub b Msgbox "b" Sheet1.Shapes("MyShape").OnAction = "a" End Sub However, if say in Module2 I also have two Subs, a and b, then I would like...
  4. A

    Drawing a Rectangle

    Hi, I am trying to draw rectangles using a set of variables and I can draw a solid box using: With plotsheet.Shapes.AddShape(1, Startx, Starty, BoxWidth, BoxHeight).Fill .ForeColor.RGB = RGB(Red, Blue, Green) .BackColor.RGB = RGB(Red, Blue, Green) End With (The items in italics are...
  5. R

    shapes vba

    Hi Guys I have the following vba codes Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim Box As Shape Set Box = Me.Shapes("Rectangle 1") If Selection.Left + Selection.Width _ + Box.Width > Rows(1).Width Then Box.Left = Selection.Left - Box.Width Else: Box.Left =...
  6. R

    Rectangle Connection Point Improvement

    I think I came across a cool workaround for gluing connectionlines to the corners of a rectangle. The normal connection points are in thecenter of each side. I wanted connection points at the corners. Using Insert Shape, I drew a large rectangle whilezoomed out to ~10%. I then zoomed into the...
  7. B

    Change the shape size based on the number of characters

    Dears, Supposing I have a rectangle shape... is it possible to change its X size based on a string's number of characters. So, if it's a big text,it should be a big rectangle. And how can I write this string's name into the rectangle? Thank you
  8. N

    Active X Control and Shape Handling

    I have 2 shapes, stacked (Rectangle 1 and 2). I have these stacked over 2 activeX controls (Labels) so that when I mouse over the group, Rectangle 2 appears/disappears. The labels are both ordered to the back and transparent. I want to take this a step further and also be able to click on...
  9. P

    Copy a shape range and export as a PNG

    Hello all, I have a Rectangle shape that has a fixed size and will not change even if the column or row size changes. It works as a frame to put information in like: tables, shapes, pictures and so on. ThisWorkbook.Sheets("Sheet4").Shapes.Range("Rectangle 1") I`m trying to find a way to...
  10. 6

    Graphic shapes flicker every time I change filters

    Problem demostration: create a new sheet, draw a big blue rectangle and write random data in A1, A2 and A3. Then set an autofilter on A1 and try to use the filter. (Unless you've a very fast PC) you will see that the big blue rectangle flickers (fastly disappear and reappear) every time you...
  11. S

    ERROR:Copy Paste Areas are different

    Greetings, Range("A4:A3").Select Range(Selection, Selection.End(xlToRight)).Copy COM.Worksheets(G).Activate Range("A2").Select Selection.End(xlToRight).Offset(-1, 1).Select Selection.PasteSpecial Paste:=xlPasteValues I am receiving an error message that...
  12. M

    Lookup with multiple variable

    I have the following sample database starting with A1 as the 1st column heading: <colgroup><col><col><col span="5"></colgroup><tbody> Colour Shape Taste Blank Colour Shape Taste Red Sphere Sweet Red Sphere Blue Triangle Bitter Blue Triangle Green Square Hot Green Square...
  13. L

    Excel copied cells remain selected after paste

    Hello, Windows 10 with Excel 2016, both updated to the day. Animation in windows is disabled for better performance. Issue: I select any number of cells / rows and copy the data, move to the new location and paste it. The selected cells / rows should get deselected automatically or at least...
  14. I

    ActiveSheet.ChartObject - doesn't move perfectly.

    Hi, I have a shape object (Rectangle - transparent) inside which i have Excel Line charts (referred by ChartObject). There are 4 charts inside this Rectangle. All of these are Grouped. The chart at the bottom that i want to specify with TOP/Left/Width/Height, based on the available space on the...
  15. M

    Use a scroll bar to change the dimensions of a rectangle

    Hello! I currently have a button that creates a rectangle the size of the active cell at the activecell. Macro as follows. Sub Add_rectangle() Dim rng As Range Dim lab As Object Set rng = ActiveCell ActiveSheet.Rectangles.Add(197.25, 108.75, 42.75, 57.75).Select Set lab =...
  16. K

    How to draw filled rectangle on XY scatter plot?

    Hello, I've been trying to add simple filled shapes (rectangle) onto my XY scatter plot in VBA. I tried using the following, but the coordinates don't match up with the xy coordinates on the plot, and seems to draw outside the plot: With MyChart.Shapes.AddShape(msoShapeRectangle, 10, 10...
  17. K

    Macro Rectangle Positioning

    Hi, I am a total VB newbie -with some googling, i have managed to draw 3 rectangles (3 macros) whose dimensions are picked from cells. I want to be able to position them such that the 3 rectangles share the same bottom-left coordinates (0,0). Also, i have written a macro to generate all 3 at...
  18. T

    Move Rectangle Shape to specific co-ordinates

    I am wondering if there is a way to use code to move a rectangle to a specific location on a sheet. I can only use "ShapeRange.IncrimentLeft" so far...which only move the shape to the left every time. Is there anyway to move a shape to point that no matter where the shape is it will always...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top