+ Reply to Thread
Results 1 to 5 of 5

Combining a Macro and Script

  1. #1
    Registered User
    Join Date
    07-11-2011
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Combining a Macro and Script

    I have a script that will sort after data is placed in a particular cell whick works.

    Please Login or Register  to view this content.

    I also have a macro which copies and pasts data which works.

    Please Login or Register  to view this content.

    I would like to combine the two so the aaa macro runs before the data sort occurs but is activated by placing the data in the particular field ( in this case "J2" which is in the first script.)
    Any suggestions would be appreciated.

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Combining a Macro and Script

    Hi, the following insertion should work just fine for you but...
    Please Login or Register  to view this content.
    ...the rest of your code could be reduced to help with run-time speeds. For instance, removing
    Please Login or Register  to view this content.
    will reduce your run-time and this does nothing helpful to your code. Anyhow, I'm about to turn in and will look at it again tomorrow, unless someone else has, to try and make the recorded code a little more task specific.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Registered User
    Join Date
    07-11-2011
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Combining a Macro and Script

    Thanks heaps Mordred It is working with just one bug.
    Whenever I enter data in "INPUT - Instructions" sheet it runs the macro..
    Is there something I can insert to have the macro run only when data is entered into "J2"
    Sorry I know this is really basic but I am very new to this. Thanks

  4. #4
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Combining a Macro and Script

    Try putting this into your procedure
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-11-2011
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Talking SOLVED: Combining a Macro and Script

    Thanks again .. After me getting my head arround your suggestion (trial and error) I put it in the correct place (lucky guess) and PRESTO it works.
    I really appreciate the efort and time you have given me many many thanks

+ 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