+ Reply to Thread
Results 1 to 5 of 5

Error message when trying to create & use macros

  1. #1
    Registered User
    Join Date
    08-25-2017
    Location
    Phoenix, AZ
    MS-Off Ver
    2013
    Posts
    74

    Error message when trying to create & use macros

    Hello all,

    I am using Office 2016 and I am not a programmer but I can usually figure things out. I've created a simple example spreadsheet which I have attached. It is a macro enabled worksheet. I want the macro to be able to show or hide rows 2 through 8 but I keep getting this error message. what am I doing wrong?

    Thanks again

    Oh, and also, is there no way to add a background color to a command button (form control)?
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,550

    Re: Error message when trying to create & use macros

    Macro needs to be in a regular module.
    Stay away from selecting as much as possible
    See changed code in attachment.

    As far as color goes, not as far as I know but you can use any shape, picture or whatever your heart desires and use it as a "macro caller".
    Attached Files Attached Files
    Last edited by jolivanes; 01-08-2022 at 10:53 PM. Reason: additional info added

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,550

    Re: Error message when trying to create & use macros

    You can shorten the code to so:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-25-2017
    Location
    Phoenix, AZ
    MS-Off Ver
    2013
    Posts
    74

    Re: Error message when trying to create & use macros

    Thank you jolivanes, I'll try that once I get the macro working

  5. #5
    Registered User
    Join Date
    08-25-2017
    Location
    Phoenix, AZ
    MS-Off Ver
    2013
    Posts
    74

    Re: Error message when trying to create & use macros

    Thank you for this one as well jolivanes. I prefer to use shapes but I couldn't get the macro to work so I switched to command buttons

+ 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. Remove Error message from macros
    By Josephrandall in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-15-2020, 03:37 PM
  2. Error message about macros - but I have no macros in my file?!
    By Hshah in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-15-2016, 09:39 AM
  3. Need to Create Error Message Box during Runtime error 1004
    By ExcelHelp2013 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-14-2013, 06:24 AM
  4. Creating error message in Excel using Macros
    By ecrolley in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-08-2012, 02:29 AM
  5. Combining two macros results in error message
    By duugg in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-01-2009, 02:42 PM
  6. Need to create a error message box
    By lostinformulas in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-12-2006, 11:40 AM
  7. How to create an error message
    By Siberian in forum Excel General
    Replies: 3
    Last Post: 06-26-2006, 02:40 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