+ Reply to Thread
Results 1 to 6 of 6

Create shapes with formatting using macro buttons

  1. #1
    Forum Contributor
    Join Date
    01-28-2014
    Location
    Manchester, UK
    MS-Off Ver
    Microsoft Office 365
    Posts
    127

    Create shapes with formatting using macro buttons

    Hello all

    I would like a very simple way to create shapes within multiple sheets with formatting.

    Does anyone know of a way that i can very easily insert shapes into a cell on multiple sheets (around 50) - Sheets named 1 - 50.

    For Example .. We have a list of buttons with Macro's assigned .. Button 1 creates Oval shapes, button 2 creates squares or rectangles etc

    We would then have a second set of buttons which would then apply formatting / styling to those shapes EG: button 1 applies a Red fill to the shapes with a black border, button 2 applies a blue fill to the shapes with a black border and so on.

    Would this be possible or does anyone know of a simpler way to achieve this?

    Thanks
    Dave

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Create shapes with formatting using macro buttons

    buttons may be a bit clunky, I would use a user form

    try the one in the attached sheet. When you run the macro, it will show a user form where you can choose the type of shape, its colour, where in the sheet to put it, and which sheets to put it in.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    01-28-2014
    Location
    Manchester, UK
    MS-Off Ver
    Microsoft Office 365
    Posts
    127

    Re: Create shapes with formatting using macro buttons

    Thanks NickyC

    That does exactly what i need it too.

    Only 1 or two slight issues .. I have another macro that runs previous too this one which unhides the number of sheets that i want (https://www.excelforum.com/excel-pro...ml#post4603907).

    When i run this macro straight after the i get a debug error would this be because i have say around another 40 hidden sheets or so which are inactive and not needed in this instance?

    Also i will always want the first sheet in the workbook to be ignored as this is used as the input sheet which the other 50 sheets grab the info from with vlookups and this first page contains the buttons to control the macro's / forms.

    But when i run selecting the range say for example create shapes in 2 - 10 a shape is still created on the 1st page (input / control page).

    Thanks
    Dave

  4. #4
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Create shapes with formatting using macro buttons

    Hi
    this version should fix those glitches. It should only put shapes on visible sheets.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    01-28-2014
    Location
    Manchester, UK
    MS-Off Ver
    Microsoft Office 365
    Posts
    127

    Re: Create shapes with formatting using macro buttons

    Hi NickyC

    That fixed the glitch perfectly.

    What i've noticed is say when i tell the macro to put the shape in Cell K1 it doesn't seem to do this it gets thrown into X1.

    Would you have any ideas what is causing this to happen .. All sheets are on "Page Break Preview" view if this makes a difference.

    Thanks
    Dave

  6. #6
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Create shapes with formatting using macro buttons

    that's odd
    I have run the macro in page layout view and it works fine
    the only way I could get that to happen is if columns K to W are hidden

    a couple of questions:
    • have you modified the code in any way?
    • is it only if you select K1, or for other cells too?
    • and if for other cells, is there a pattern (eg always 13 columns to the right of the one you enter)?
Reply With QuoteRegister To Reply

+ 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] VBA Solution to Copying Command Buttons and Shapes
    By DarkF1ame in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-16-2016, 06:49 PM
  2. [SOLVED] Macro to create a range of cells containing shapes
    By NickyC in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-03-2015, 12:22 AM
  3. Unable to Hide/Unhide Shapes and Buttons with VBA: Error 400
    By mp4-4 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-21-2013, 03:58 PM
  4. Can I Hide Shapes That Are Buttons???
    By JonesZoid in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-08-2012, 05:32 PM
  5. How to create Macro Buttons?
    By elfiky in forum Excel General
    Replies: 2
    Last Post: 08-25-2011, 09:05 PM
  6. How to create buttons with macro on VBexcel
    By forse84 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2010, 10:07 AM
  7. Formatting buttons & drawing shapes.
    By nomadscot in forum Excel General
    Replies: 4
    Last Post: 07-15-2006, 11:52 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