+ Reply to Thread
Results 1 to 7 of 7

Assign 2 Macros to 1 Button (or Adding VBA code to the existing macro)

  1. #1
    Forum Contributor
    Join Date
    02-11-2009
    Location
    Fair Lawn, NJ
    MS-Off Ver
    Excel 2007
    Posts
    217

    Assign 2 Macros to 1 Button (or Adding VBA code to the existing macro)

    Hey,

    I'm verrry new to editing VBA code and I've been trying to figure out how to send a column of data ("Min Data" AB3:AB21 from "Sheet1") to a worksheet ("F4" - Min) and sending another column of data ("Max Data" AC3:AC21 from "Sheet1") to a different worksheet ("F4" - Max) by using only the one button ("Record Data" from "Sheet1"

    I've been trying to figure out ways to edit the VBA in "Module 1" to make this work

    Can anyone help me out here? If what i'm asking for isn't clear enough, just let me know and i'll try to explain in more detail

    Thank you for your time
    Bob
    Attached Files Attached Files
    Last edited by sighlent1; 12-30-2009 at 11:14 AM. Reason: solved

  2. #2
    Forum Contributor
    Join Date
    09-23-2008
    Location
    UK
    Posts
    137

    Re: Assigning 2 Macros to 1 Button (or Adding VBA code to the existing macro)

    you should be able to do this just by recording the macro, no need to edit - what are you trying to change?

  3. #3
    Forum Contributor
    Join Date
    02-11-2009
    Location
    Fair Lawn, NJ
    MS-Off Ver
    Excel 2007
    Posts
    217

    Re: Assigning 2 Macros to 1 Button (or Adding VBA code to the existing macro)

    When F4 reads 1098 and I hit the "Record Data" button, it records the data in worksheet "1098 - Min". I'd also like the macro to take the information from AC3:AC21 and record it in "1098 - Max". I didn't create the macro, otherwise i would just re-record it, so i've just been editing the VBA code to do what i want it to. any idea how i can make this work?

    Thank you,
    Bob

  4. #4
    Forum Contributor
    Join Date
    09-23-2008
    Location
    UK
    Posts
    137

    Re: Assigning 2 Macros to 1 Button (or Adding VBA code to the existing macro)

    this solution is probably very sloppy because I am in a rush to go for a beer. But it might help you along.
    Attached Files Attached Files

  5. #5
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Assigning 2 Macros to 1 Button (or Adding VBA code to the existing macro)

    Untested. Try it on a back up copy first.
    Note: I have cleaned up the unnecessary "range.select" statements as they are not needed. Only the first cell in the target paste range needs to be specified.

    Please Login or Register  to view this content.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  6. #6
    Forum Contributor
    Join Date
    02-11-2009
    Location
    Fair Lawn, NJ
    MS-Off Ver
    Excel 2007
    Posts
    217

    Re: Assigning 2 Macros to 1 Button (or Adding VBA code to the existing macro)

    Quote Originally Posted by firefly2k8 View Post
    this solution is probably very sloppy because I am in a rush to go for a beer. But it might help you along.
    hahahaha, cheers man....i think i need to get out of here soon for a 12 pack myself

    Happy Holidays

  7. #7
    Forum Contributor
    Join Date
    02-11-2009
    Location
    Fair Lawn, NJ
    MS-Off Ver
    Excel 2007
    Posts
    217

    Re: Assigning 2 Macros to 1 Button (or Adding VBA code to the existing macro)

    Hey Palmetto,

    I'm not sure why, but i got an error with that code...after deleting what was in my "Module 1", i pasted the VBA code in and i got an error message

    I'm gonna toy with it and see what happens though

    Thank you sooo much and if i don't hear from you, Happy Holidays
    Bob

+ 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