Run a macro on grouped worksheets only

The Title says it all really:
I want to run a macro on Grouped worksheets only, not on all worksheets in the workbook (I know how to code for all sheets in a workbook)
Anyone give me a hand with the code I need to use?
Many thanks

Sub Macro1()
Dim sh As Worksheet
For Each sh In ActiveWindow.SelectedSheets
'Use sh as an object in your code
MsgBox sh.Name
Next sh
End Sub

Similar Messages

  • How do I group by only one column in a SELECT statement?

    Hi everyone,
    Here is my novice question:
    I would like to run a query where I select (display) several columns from my table, yet group (categorize) by one of these columns.
    For example:
    SELECT A, B, COUNT(A)
    FROM TableX
    GROUP BY A
    I realize now that this is not valid. My first question is why? Doesn't it make sense that you would want to group by only one of the columns? To me, it seems natural that you would most often want to categorize by one attribute, which is why it seems odd that this is not valid. I realize that I can remove column B, but I do want to display that info. I could also change the last statement to GROUP BY A, B to avoid errors, but this will also not display what I am looking for.
    In addition to understanding why Oracle is set up this way, I guess I also need to know how I can legally accomplish this query, grouping by A but also displaying the values of B.
    Thank you very much for your help!
    Holly

    Hi everyone,
    Thank you for your responses... very interesting and useful. Since I came across inline views in my reading, I tried the approach recommended by g feng, although I am eager to try the other approaches too.
    I ended up using an inner join simply to get more descriptive info. on the column that was being counted. With Y representing this second table, Y.B being the column containing the descriptive info., and A being the common key between X and Y, here is the simple code I came up with.
    SELECT Y.B, V.*
    FROM Y,
    SELECT A AV, COUNT (*)
    FROM X
    GROUP BY A
    ) V
    WHERE V.AV = Y.A
    Does this seem correct... anything I need to watch out for?
    Thanks again to everyone for your help!!
    Holly

  • How to run Excel Macros using JDBC-ODBC

    Hi,
    I want to run the excel macros in the excel file, after I connected to excel file, using JDBC-ODBC bridge.
    How macros treated here?
    Help needed please..........
    - Ramesh

    How to run Excel Macros using JDBC-ODBCYou don't.
    As my fuzzy understanding goes.....
    Macros (excel, word, etc) run via a "OLE" extension of the script host system.
    So the only way to run them is via the OLE interface. That has nothing to do with ODBC. You can write your own JNI to do that, or you might get lucky and find that someone else has written a java library to do it for you.

  • Allow distribution group members only to send to distribution group

    Is it possible to allow the members of a distribution group to be the only ones permitted to send to the distribution group? I've read up on this and I think it's possible with a custom RBAC role. Any other ideas?
    Thanks! 

    You don't need RBAC for this - you just need to go to the Mail Flow Settings
    tab and open the Message Delivery Restrictions properties.  Add the group to the
    Accept messages from: Only senders in the following list.  This will limit it so that only messages from members of the group can send to it.
    You can also use the shell to do this by running:
    Set-DynamicDistributionGroup -Identity <group name> -AcceptMessagesOnlyFromSendersOrMembers <group name>

  • Error "Not all data could be changed in LC" when running DP macro

    We are getting the error, "Not all data could be changed in LC" when running DP macros and we are not sure why. It seems to only happen when we are executing it via a Process Chain but not using the DP background processing scheduling. Does anyone know why this is happening?

    Hi Stacy,
                         I hope you are seeing this in message spool.  This message comes up for various reasons. We used to see a message saying "No data saved".
    Some of the reasons could be " the new value (lets say 3 ) after the macro execution is same as after execution (3)".
    See if some of the values are fixed and could not be changed.
    I would take a selection id with just few values and execute the job for that selection id and compare the pre and after results. That should answer all your questions.

  • Cannot run the macro SOLVER.XLAM!MainEx error message

    Ive had this problem for awhile but am now needing to use solver for my schoolwork. 
    Anytime i try to use the solver function under the data tab this error message pops up. 
    I have tried taking off and readding the add-in under options. 
    when i try to access solver in the visual basic panel it asks for a password which i have never set
    Im running excel 2013 on windows 7
    I have tried many things and am exhausted. No solution has been posted to this problem on the site or anywhere on the web 
    THIS IS NOT WHEN IM TYPING MACRO CODE IN VBA. its just when i try to use solver for simple spreadsheet calculations. 
    when i click solver i get the error cannot run module: SolverCode
    when i try to access the solver code in vba a password is required 

    Hi,
    As far as I know,  the Solver add-in code has the password by design, it is protected on purpose and copyrighted. They are designed for use from the spreadsheet only. 
    Then, as the error message:" Cannot run the macro SOLVER.XLAM!MainEx error message." Please try to do the following methods to fix the issue:
    1. Open VBE (Alt+F11)>Click Tools> References>set to SOLVER>Show immediate code pane (Ctrl+G)>Copy/paste (or write): application.run "solver.xlam!auto_open"
    2. Disable the other Excel add-ins, such as
    Adobe PDFMaker.
    3. Repair Office 2013.
    Regards,
    George Zhao
    TechNet Community Support

  • Group Message only sends iMessages not SMS

    Hello all. I just recently moved to Android but my spouse is still on an iPhone. For some reason, when she group messages it is only sending responses to those with imessage on their phone.  However if she sends me a non group message (only me) it recognizes it as a SMS, turns green and sends the text perfectly. However it will not recognize that I do not have imessage when sending a group text.
    She has iMessage, Send as SMS, MMS Messaging and Group Messaging all turned all, but no luck.
    The other people with iphones in the group, can send the group texts and their iphones are converting my text to SMS. Its just my wifes phone not sending me SMS when I am in a group, only sending me a SMS when direct to me only..
    The phone is updated to the latest software, and I even rebooted her phone with no luck..
    Anyone have any idea what is happening?
    Arghh...........

    You can only send imessage to other iphone user running IOS 5.0 or higher.
    Other phone will send as a text.  http://support.apple.com/kb/HT3529

  • Effective Permissions to send email to distribution group having "only senders in the following list"

    Our environment is a mixed Exchange 2007 and Exchange 2010 server environment, still in transition (after 4 years). Users have Exchange 2007 mailboxes. A recent problem has been reported in a distribution group access model that has been working without
    complaint for several years.
    [email protected] has member John Doe ([email protected]), Jane Doe ([email protected]), "only senders in the following list" is set to GroupA
    [email protected] has member Rob Smith ([email protected]), Diane Smith ([email protected]), "only senders in the following list" is set to GroupB
    [email protected] has members GroupA, GroupB, "only senders in the following list" is set to GroupC
    When designed, we thought that when [email protected] sends an email to [email protected] it would be resolved to the user members of GroupC and delivered to everyone ([email protected], [email protected], [email protected], [email protected]). (While
    it seems unlikely, that this model has functioned for several years without experiencing this problem, it is conceivable that until recently [email protected] and [email protected] have with few exceptions always had the same membership. Recent changes in
    our organizational model have caused this to have some exceptions, and may be the root cause of this problem.)
    What we are experiencing is that users [email protected] and [email protected] receive the original email. Users [email protected], [email protected] do not receive the email. [email protected] receives an email "Undeliverable: test
    Delivery has failed to these recipients or distribution lists:
    [email protected]
    Your message wasn't delivered because of security policies. Microsoft will not try to redeliver this message for you. Please provide the following diagnostic text to your system administrator. Sent by Microsoft Exchange Server 2007.
    Diagnostic information for administrators
    Generating server: mail3.domain.com
    [email protected]
    #550 5.7.1 RESOLVER.RST.NotAuthorized; not authorized ##
    Original message headers:
    Received: from MAIL7.domain.com ([::1]) by mail3.domain.com ([::1]) with
    mapi; Mon 9 Mar 2015 07:00:30 -500
    Content-Type: application/ms-tnef;name="winmail.dat"
    Content-Transfer-Encoding: binary
    From: Jane Doe <[email protected]>
    To: GroupC <[email protected]>
    Date: Mon 9 Mar 2015 07:00:29 -500
    Subject: test
    What is the expected behavior?
    Does Exchange resolve the "To" distribution group to member mailboxes for delivery purposes, or does it walk the subordinate child groups and check security at each level?
    Is this a configurable behavior that may have recently changed as we have a "new" Exchange Admin poking around?
    Might this be related to the mixed Exchange 2007 / 2010 environment?
    Is there a way to obtain "effective permissions" for delivery restrictions?
    emc2

    Hi,
    From your description, I would like to verify if you have done some changes for GroupB distribution group. Ensure that "[email protected]" is added to the "accept list" in GroupB's message delivery
    restrictions.
    What's more, are GroupA GroupB and GroupC Exchange 2010 distribution groups?
    Best regards,
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
    Amy Wang
    TechNet Community Support

  • Excel VBA: Getting error 1004 using APPLICATION.RUN to run a macro

        
    I'm getting a 1004 error when my ADDIN tries to launch a macro already in a workbook .
    The macro resides in a workbook (on disk before it was opened in this session) and the addin opened the workbook, updated some data fields in spreasheets in the workbook and now is trying to cause the macro, already in that workbook, to execute as though
    the user had opened the workbook, made the changes, and clicked the button connected to that macro.  What the addin copied into the workbook was data in cells that the macro uses for inputs to its calcualtions.
    The error reads: "The macro may not be available in this workbook or all macros may be disabled"
    The command in question is in an ADDIN and its code is effectively:
    v2="Taxplan Template 1.17.xlsm!SUMMARIZEYEAR
    Application.run v2
    ...etc
    Immediately upon executing "Application.run " it jumps to the on error location.
    Taxplan Template 1.17.xlsm is open and accessible (the addin has just copied data into it and the macro is to update a summary based on that updated data) and it contains the macro Summarizeyear which has no arguments and is not private. 
    If I set a breakpoint in the addin right before the "Application.run", stop the addin and manually run the macro it works fine.  It begins like:
    Sub SummarizeYear()
    Sheets("Summary").Select
    ...etc
    If I manually open the workbook  Taxplan Template 1.17 I can run the macro SUMMARIZEYEAR without issue.
    Macros are enabled in Excel.
    Probably not pertinent but I've used the same style of code with .xls workbooks in the past without a hitch, this is the first instance where I used it with .xlsm format workbooks.
    Excel 2007 SP3
    Thanks

    I'm getting a 1004 error when my ADDIN tries to launch a macro already in a workbook .
    The macro resides in a workbook (on disk before it was opened in this session) and the addin opened the workbook, updated some data fields in spreasheets in the workbook and now is trying to cause the macro, already in that workbook, to execute as though
    the user had opened the workbook, made the changes, and clicked the button connected to that macro.  What the addin copied into the workbook was data in cells that the macro uses for inputs to its calcualtions.
    The error reads: "The macro may not be available in this workbook or all macros may be disabled"
    The command in question is in an ADDIN and its code is effectively:
    v2="Taxplan Template 1.17.xlsm!SUMMARIZEYEAR
    Application.run v2
    ...etc
    Immediately upon executing "Application.run " it jumps to the on error location.
    Taxplan Template 1.17.xlsm is open and accessible (the addin has just copied data into it and the macro is to update a summary based on that updated data) and it contains the macro Summarizeyear which has no arguments and is not private. 
    If I set a breakpoint in the addin right before the "Application.run", stop the addin and manually run the macro it works fine.  It begins like:
    Sub SummarizeYear()
    Sheets("Summary").Select
    ...etc
    If I manually open the workbook  Taxplan Template 1.17 I can run the macro SUMMARIZEYEAR without issue.
    Macros are enabled in Excel.
    Probably not pertinent but I've used the same style of code with .xls workbooks in the past without a hitch, this is the first instance where I used it with .xlsm format workbooks.
    Excel 2007 SP3
    Thanks
    This line is not quite correct,
    v2="Taxplan Template 1.17.xlsm!SUMMARIZEYEAR
    it is missing the closing double quote, also since your file name contains a space, I would also enclose it in single quotes.

  • HT1926 My iTunes installer was interrupted & now it's telling me "Your system has not been modified.  To complete these operations at a later time, please run the installer again". The only problem is, I've tried to run it about six or seven times.  Can s

    My iTunes installer was interrupted &amp; now it's telling me "Your system has not been modified.  To complete these operations at a later time, please run the installer again". The only problem is, I've tried to run it about six or seven times.

    I'm not sure anyone here knows more about the Java plugin than you do...
    Were you starting the control panel from disk as administrator because it didn't work starting it through the Start menu (if you have Control Panel set to View by Category, the Java control panel is under "Programs").

  • How to run the Macro in RTF

    Hi Tim,
    Do you know how to run the WORD macro in RTF?
    Suppose I want to run the macro for Section Break, Is there any way we can call it using WORD Macro.
    Any help is appriciated.
    Thanks,
    Ambadas

    Hi Ambadas
    Now, Im not entirely sure what you mena by:
    'Do you know how to run the WORD macro in RTF?'
    Are you looking to run a macro to create a section break for you during the design of the template? - you can do this.
    Or do you want to embed a macro in the RTF output - you can not do this - RTF does not support macros.
    Please explain further.
    Regards, Tim

  • I want to use Boot Camp to run a tax program that will only use explorer. Whick windows program do I need to install in Boot Camp

    I want to use Boot Camp and windows 7 or 8, preferrably 7 to run a tax program that will only let me use explorer.  I am using a Mac Book Pro with OSX Maverick 10.9.  There are so many windows programs out there it is confusing which one I need.  I don't think that I will need Office.

    http://www.apple.com/support/bootcamp/
    I would use Windows 7 any full version except the trial, or a branded Dell, HP, etc. versions

  • SharePoint Hosted App to Read members of Site owner group, if "Who can view the membership of the group? " is set to Group members only

    Hi,
    Is there a way to read group members of site owner group via SharePoint hosted app . The "Who can view the membership of the group? " is set to Group members only. As per my research SCA can only view the group members of site owner group
    if this settings is applied.
    Thanks,
    Sudhir
    Sudhir rawat

    See this.
    Avoid changing the MaxPageSize LDAP query policy
    http://jeftek.com/219/avoid-changing-the-maxpagesize-ldap-query-policy/
    Regards~Biswajit
    Disclaimer: This posting is provided & with no warranties or guarantees and confers no rights.
    MCP 2003,MCSA 2003, MCSA:M 2003, CCNA, MCTS, Enterprise Admin
    MY BLOG
    Domain Controllers inventory-Quest Powershell
    Generate Report for Bulk Servers-LastBootUpTime,SerialNumber,InstallDate
    Generate a Report for installed Hotfix for Bulk Servers

  • Cannot run the macro 'YIELD'. The macro may not be available in this workbook or all macros may be disabled.

    Dear Sir,
              While i am calling Excel function through asp.net  using Excel 2003 i  was not facing any kind of issue it's working fine but while i am calling  Excel functions through asp.net using 
    Excel 2010  i am facing an issue even after enabling the micro in settings . issue is 
    "Cannot run the macro 'YIELD'. The macro may not be available in this workbook or all macros may be disabled." please solve this as soon as possible .
    Thanks & Regards
      Sanjeev

    // I made a singleton class and calling that class to access Excel functions
    Public Class Singleton
        Private Shared objexcel As Excel.Application
        Private Shared lock As New Object
        Private Sub New()
            System.Console.WriteLine("Instance of Singleton class created at : " & Now())
        End Sub
        Public Shared Function GetInstance() As Excel.Application
            SyncLock lock
                If objexcel Is Nothing Then
                    objexcel = New Excel.Application
                    objexcel.RegisterXLL(objexcel.LibraryPath & "\Analysis\ANALYS32.XLL")
                End If
                Return objexcel
            End SyncLock
        End Function
    End Class
    // Common Function for yield 
    Public Sub CalculateYield( _
               ByVal YTMDate As Date, ByVal FaceValue As Double, ByVal Rate As Double, _
               ByVal NonGovernmentFlag As Boolean, ByVal RateActualFlag As Boolean, _
               ByVal MaturityDate As Date, ByVal MaturityAmt As Double, _
               ByVal CouponDate As Date, ByVal CouponRate As Double, _
               ByVal CallDate As Date, ByVal CallAmt As Double, _
               ByVal PutDate As Date, ByVal PutAmt As Double, ByVal intFrequency As Int16, _
               ByVal strOption As String, ByVal dblResult As Double, ByVal strSemiAnnFlag As String)
            Try
                Dim decMarketValue As Double
                Dim intBasis As Int16
                decMarketValue = IIf(RateActualFlag = True, Rate * FaceValue / 100, Rate)
                decMarketValue = decMarketValue * 100 / FaceValue
                decMarketValue = objCommon.DecimalFormat(decMarketValue)
                MaturityAmt = MaturityAmt * 100 / FaceValue
                MaturityAmt = objCommon.DecimalFormat(MaturityAmt)
                CallAmt = CallAmt * 100 / FaceValue
                CallAmt = objCommon.DecimalFormat(CallAmt)
                PutAmt = PutAmt * 100 / FaceValue
                PutAmt = objCommon.DecimalFormat(PutAmt)
                intBasis = IIf(NonGovernmentFlag = True, 3, 4)
                If strOption = "Y" Then
                    With Singleton.GetInstance
                        If MaturityDate <> Date.MinValue And MaturityDate > YTMDate Then
                            dblYield = CType(Singleton.GetInstance.Run("YIELD", YTMDate, MaturityDate, CouponRate / 100, decMarketValue, MaturityAmt,
    intFrequency, intBasis), Double)
                            dblYTMAnn = CType(Singleton.GetInstance.Run("EFFECT", dblYield, intFrequency), Double)
                            dblYTMSemi = CType(Singleton.GetInstance.Run("NOMINAL", dblYTMAnn, 2), Double)
                            'End If
                            dblYTMAnn = dblYTMAnn * 100
                            dblYTMSemi = dblYTMSemi * 100
                        Else
                            dblYTMAnn = 0
                            dblYTMSemi = 0
                        End If
                        If CallDate <> Date.MinValue And CallDate > YTMDate Then
                            dblYield = CType(Singleton.GetInstance.Run("YIELD", YTMDate, MaturityDate, CouponRate / 100, decMarketValue, MaturityAmt,
    intFrequency, intBasis), Double)
                            dblYTCAnn = CType(Singleton.GetInstance.Run("EFFECT", dblYield, intFrequency), Double)
                            dblYTCSemi = CType(Singleton.GetInstance.Run("NOMINAL", dblYTMAnn, 2), Double)
                            'End If
                            dblYTCAnn = dblYTCAnn * 100
                            dblYTCSemi = dblYTCSemi * 100
                        Else
                            dblYTCAnn = 0
                            dblYTCSemi = 0
                        End If
                        If PutDate <> Date.MinValue And PutDate > YTMDate Then
                            dblYield = CType(Singleton.GetInstance.Run("YIELD", YTMDate, MaturityDate, CouponRate / 100, decMarketValue, MaturityAmt,
    intFrequency, intBasis), Double)
                            dblYTPAnn = CType(Singleton.GetInstance.Run("EFFECT", dblYield, intFrequency), Double)
                            dblYTPSemi = CType(Singleton.GetInstance.Run("NOMINAL", dblYTMAnn, 2), Double)
                            dblYTPAnn = dblYTPAnn * 100
                            dblYTPSemi = dblYTPSemi * 100
                        Else
                            dblYTPAnn = 0
                            dblYTPSemi = 0
                        End If
                    End With
                End If
            Catch ex As Exception
                Throw ex
            End Try
        End Sub
    // call  yield function
    GlobalFuns.CalculateYield(datYTM, decFaceValue, decRate, blnNonGovernment, blnRateActual, datMaturity, decMaturityAmt, _
                                   datCoupon, decCouponRate, datCall, decCallAmt, datPut, decPutAmt, Val(Hid_Frequency.Value
    & ""), "Y", 0, "")
    this code  is working in Excel 2003 but it's not working in Excel 2010
    //Error is
    Cannot run the macro 'YIELD'. The macro may not be available in this workbook or all macros may be disabled.

  • Run a macro with ABAP code

    Hi everybody,
    Could someone help me finding a way to run a macro of an excel sheet with an ABAP program.
    Explanation:
    - I launch an abap program that opened an excel sheet with that kind of code
    include ole2incl.
    DATA : w_excel   type ole2_object,
               w_books   type ole2_object,
               w_book    type ole2_object,
               w_sheets  type ole2_object,
               w_sheet   type ole2_object,
               w_cell    type ole2_object,
               w_rows    type ole2_object,
               w_font    type ole2_object.
    create object w_excel 'Excel.Application'.
    CALL METHOD OF W_EXCEL 'WORKBOOKS' = W_BOOKS.
    CALL METHOD OF W_SHEET 'CELLS' = W_CELL
           exporting #1 = row
                     #2 = column.
    CALL METHOD OF W_SHEET 'SAVEAS'.
    With my ABAP program:
    - i can open my excel template.
    - i can write and format data inside my excel sheet.
    - i can close and save my excel sheet.
    but i don't how to run the macro that exists in my excel template.
    Thank you in advance.

    Hi,
    Executing Excel Macro from SAP ABAP
    I am populating data in excel sheet using OLE. This excel document contains Macro.
    Is there any way I can start execution of Macro as soon as data is populated in Excel sheet.
    If you are using OLE to populate the Excel Sheet then, then yes you can run a macro.
      CALL METHOD OF OBJ_EX_APP 'Run'
           EXPORTING #1 = MACROSTR.
    Adding a Field Exit
    To add a field exit first find the data element that is linked to the screen field- the screen number and program
    Run program RSMODPRF. You will need to create two function modules one FIELD_EXIT_MEPO_VENDOR and
    FIELD_EXIT_MEPO_VENDOR_A
    FIELD_EXIT_MEPO_VENDOR should have code simply of input = ouput.
    FIELD_EXIT_MEPO_VENDOR_A should have the code for whatever the functionality is required
    Go back to RSMODPRF and run the program without parameters. Use the push buttons to assign the screen, 'A' and program. Use the drop down to activate the field list.
    This should now work, but there is no way of debugging. For further information look at OSS 29377
    program zzdirlist.
    for AIX this method also works.
    DATA: BEGIN OF TABL OCCURS 0,
          TEXT(80) TYPE C,
          END OF TABL.
    DATA: COMMAND(256) TYPE C.
    COMMAND = 'ls'.
    CALL FUNCTION 'RFC_REMOTE_PIPE' DESTINATION 'SERVER_EXEC'
    EXPORTING COMMAND = COMMAND
    READ = 'X'
    TABLES PIPEDATA = TABL.
    LOOP AT TABL.
       WRITE:/ TABL-text.
    ENDLOOP.
    Open the following link,
    http://www.sap-img.com/abap/questions-about-bar-code-printing-in-sap.htm
    Regards,
    Jagadish.

Maybe you are looking for

  • HT1338 I cannot open encrypted files/folders on my back up disc.

    Hi, I created an encrypted disc, with disc utility. It is a .sparseimage type file, 128 encryption, password protected. I can open it on my Mac no problem, I took the password off the keychain (as advised) and if I try to open the disc (which I place

  • NW 7.0 EHP1

    Hi, We have a partner license for NW 7.0 Stack. Please let me know how and from where I can download NW 7.0 EHP1. Do we need to get license separately for NW 7.0 EHP1 ? Regards, Nallasivam.D

  • Sales BOM Header Material should not come in J1IJ or delivery

    Hi, We have one depot plant,  Now i am using the sales BOM, I have created one Material header with item category LUFM  pricing at item level only, BOM is created, When I am entering the Header material in SO  then alll child items are coming, then w

  • Is this forum related to the Sony Mobile company?

    Hello all, I would like to know if the team answering the questions here is related to thr company Sony Mobile? I have spent nearly 8 months with 1 phone of my small company's 8 devices (all Sony Xperia phones or tablets) I have written several email

  • LSMW for MSC1N Transaction to Create Batch

    Hi, I want to create Multiple batches for Large number of Materials. Could any body Please suggest me how to write LSMW for MSC1N. Thanks Bhuvana