+ Reply to Thread
Results 1 to 3 of 3

Convert code in a class module to a macro

  1. #1
    Registered User
    Join Date
    10-10-2012
    Location
    Warks
    MS-Off Ver
    Excel 2013
    Posts
    91

    Convert code in a class module to a macro

    In the attached sheet I have a command button which copies filtered information to Sheet2. The functionality of this command button is fine, what I'm trying to do is assign the code as a macro to a normal button that I can edit. Here is the code:
    Please Login or Register  to view this content.
    Now I'm clueless when it comes to coding but I gather I need to convert the "Me" part of the code to be able to use it in a module as opposed to a class module? If trying to assign it as a macro screws the functionality of the code, is there a way to format the command button (all the format options seem to be greyed out).

    I've probably explained that terribly, basically what it comes down to is I want to make the command button more attractive but can't see a way of doing so unless I create a standard button and assign it a macro.

    Sample 7 macro.xlsm

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Convert code in a class module to a macro

    replace 'Me' with ActiveSheet if you want to refer to the sheet that has the button on it
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    10-10-2012
    Location
    Warks
    MS-Off Ver
    Excel 2013
    Posts
    91

    Re: Convert code in a class module to a macro

    Hi, thanks for that. That works fine with the sample file but for some reason I'm receiving an error that just says 400 when I use it in my project but this is obviously a separate issue altogether.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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