+ Reply to Thread
Results 1 to 9 of 9

VBA to format an object

Hybrid View

  1. #1
    Registered User
    Join Date
    09-22-2011
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    55

    VBA to format an object

    Hi,

    I am trying to change the colour of an object using VBA.
    The following formula returns the correct number value. A number from 1 to 9

    =SUMIF(SCENARIOS!A6:A600,chosenUID,SCENARIOS!E6:E600)

    The result of the above formula is contained in the name of the object ie "Multiply 1" through to "Multiply 9"

    Thanks
    Primed

  2. #2
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,071

    Re: VBA to format an object

    Hi Primed,

    What is the object?

    Can you post the file.

    Thanks
    Remember you are unique, like everyone else

  3. #3
    Registered User
    Join Date
    09-22-2011
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    55

    Re: VBA to format an object

    Hi,

    File attached.

    If you know how to draw the baseball home run fence feel free.I've tried a few times but cant get it to look right.

    Primed.
    Attached Files Attached Files

  4. #4
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,071

    Re: VBA to format an object

    Thanks,

    Are you creating a game?

  5. #5
    Registered User
    Join Date
    09-22-2011
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    55

    Re: VBA to format an object

    Hi,

    I wouldn't give it game status, more of an experiment at the moment. Slow going with my limited programming knowledge.

    Primed

  6. #6
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,071

    Re: VBA to format an object

    OK, If you want to go for a game type application, the below link might help.

    HTML Code: 
    You may need the VB type environment to build this.

    The VB Express app is available for free.

    I'm not trying to advise you to go to VB but it using the same language & can produce the result you might want.

    If you have a look at the series from this guy, you may get some inspiration for your idea.

    Hth.

  7. #7
    Registered User
    Join Date
    09-22-2011
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    55

    Re: VBA to format an object

    Hi Hth,

    Happy new year.
    I watched quite a few of the tutorials and got lots of inspiration however i kept running into issues with the software being out of date for my new computer. Then of course once i installed the updated software the code wouldn't work. I think i'll stick with excel for now to get the concept done then employ a professional later.

    I sussed out the format using the record macro and cutting and pasting the code.

    Thanks
    Primed

  8. #8
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,071

    Re: VBA to format an object

    No worries.

    Btw, Hth means 'Hope this helps'

  9. #9
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: VBA to format an object

    Try this code to change the background color of the shape object.

    Shapes("Multiply 5").Fill.BackColor.RGB = RGB(255, 0, 0)
    'or
    Shapes("Multiply 5").Fill.BackColor.SchemeColor = 1
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

+ 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] Format object colour dependant on cell value
    By Grimace in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-27-2013, 02:28 AM
  2. Conditional Format of an object
    By rajeev.raj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-19-2011, 05:51 AM
  3. Object Format
    By zhshqzyc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-27-2011, 03:33 PM
  4. Conditional format and object
    By jeremy3721 in forum Excel General
    Replies: 5
    Last Post: 09-11-2007, 03:36 PM
  5. Format Object
    By Rikuk in forum Excel General
    Replies: 0
    Last Post: 07-31-2007, 07:19 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