Applescript: How do i loop a script between two sheets in one workbook?

My office uses excel for its invoices and they have tasked me with finding a way to automatically name the invoice tabs in the workbook which are set up between two dummy sheets. What I have works but does not do exactly what they asked.
This is what I have so far:
tell application "Microsoft Excel"
          repeat with x in (get selected sheets of active window)
                    try
                              set name of x to string value of range "T18" in ws
                    on error
                              display dialog "Re-name failed" buttons {"Cancel"} with icon 0
                    end try
          end repeat
end tell
As of now I have to highlight the sheets in the workbook I want the script to run on. I would like to be able is to run the set name script between two sheets (Dummy 1 & Dummy 2) without having to highlight any scripts. I thought of using a from to with the repeat function but that has to be an integer. Any ideas would be welcome as at best I would call myself an ametuer with just enough knowledge to get in trouble.

Ah, that is a little tricky.  try this instead.
tell application "Microsoft Excel"
          tell workbook 1
                    set sheetHolder to sheet "Dummy 1"
                    repeat
  -- get next sheet
                              set currentSheet to next of sheetHolder
  -- check for end sheet and exit
                              if name of currentSheet is "Dummy 2" then exit repeat
  -- rename (exit on failure)
                              try
                                        set name of currentSheet to string value of cell "T18" of currentSheet
                              on error
                                        display dialog "Re-name failed" buttons {"Cancel"} with icon 0
                                        exit repeat
                              end try
  -- crawl across sheets, inchworm style
                              set sheetHolder to currentSheet
                    end repeat
          end tell
end tell

Similar Messages

  • How do i stop contact synching between two iPhones?

    how do i stop contact synching between two iPhones?

    Stop syncing them to the same source. If you're sharing an iCloud account with someone, don't do that.

  • HT5646 should I set up a different account for each child?  if so, how do I manage itunes money between two kids?

    should I set up a different apple account for each child?  if so, how do I manage itunes money between two kids?

    Hello staatsfamily,
    Having a separate Apple ID for each child will allow each child to keep their purchases and iCloud information separate.  It will also allow you to provide an iTunes Store Allowance for each child:
    With iTunes Allowance, you can send a monthly iTunes Store credit to anyone with an iTunes Store account. It's a great way for parents to manage their children's spending on the iTunes Store, App Store, and iBooks Store.
    Once you have created an Apple ID for each child, you can provide an iTunes Store allowance to each Apple ID. The following article will guide you in how to set this up:
    iTunes Store Allowance
    http://support.apple.com/kb/ht2105
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • How to find the structural difference between two tables

    Hi all,
    How to find the structural difference between two tables .
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE 11.1.0.7.0 Production
    TNS for 32-bit Windows: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    Thanks,
    P Prakash

    you could try something similar to this, for each table pair that you want to compare:
    SELECT 'TABLE_A has these columns that are not in TABLE_B', DIFF.*
      FROM (
            SELECT  COLUMN_NAME, DATA_TYPE, DATA_LENGTH
              FROM all_tab_columns
             WHERE table_name = 'TABLE_A'
             MINUS
            SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
              FROM all_tab_columns
             WHERE table_name = 'TABLE_B'
          ) DIFF
    UNION
    SELECT 'TABLE_B has these columns that are not in TABLE_A', DIFF.*
      FROM (
            SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
              FROM all_tab_columns
             WHERE table_name = 'TABLE_B'
             MINUS
            SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
              FROM all_tab_columns
             WHERE table_name = 'TABLE_A'
          ) DIFF;that's assuming, column_name, data_type and data_length are all you want to compare on.

  • How to define the dynamic navigation between two component in web ui

    Hi All,
    I have a requirement to create a new assignment block in accounts overview screen .
    1.Created new view(Table view) in the BP_HEAD component.
    2.Created new button on the table view toolbar .
    3.If the user clicks the new button it should navigate to interaction log component(BT126H_CALL).
    Please hekp me step 3 how to do .
    I have checked planned activity assignment block in the account but is dynamic navigation.
    Please explain me how to define the dynamic navigation between two components.
    What is window delegate .
    Thanks,
    Venkyy

    Hi ,
    Kindly follow the link , this will be helpful for your issue :
    http://wiki.sdn.sap.com/wiki/display/CRM/CRM-NavigatingtoyourcustomBSP+component

  • How to export a weblogic application between two workshops

    i need to develop an application on two different computers. how to make the application portable between two workshops?
    Thanks.
    Denis

    Thanks for the response, but correct if I'm wrong: I just could use this option to export to war file if I had the source code and the project created under the eclipse IDE. If so, I'm not able to do that, since I haven't received any source code from this vendor. I have only received one windows installer which installs the war files inside the weblogic domain\server folder.
    I thought that there was an option under the weblogic administration console -> domain -> deployments which would let me export an existing application to a war file.
    So far, I've found one work around that is:
    * Run the windows installer of this app into a weblogic running on a windows box ;
    * Once the deployment is up, go into the PATH where this application is running inside the weblogic and generate a war file with all the existing files ;
    * Open the weblogic administration console of the linux box;
    * Import the war file ;
    Thanks,
    Davinod

  • How to perform a WS-transaction between two webservices implemented in EJB3

    Hello,
    I would like to have an example of how to perform a WS-Transaction between two web services implemented with EJB 3.0. It should be done through code.
    Thanks in advance.

    Bit a late answer, btu I don't like googling for somthing and founding open questions about the topic I search for.
    Have a look at
    http://jbossws.jboss.org/mediawiki/index.php?title=JAX-WS_User_Guide
    and
    http://soa.sys-con.com/node/39769
    Cheers

  • How to center object between two guides (or one guide and edge of artboard)

    Simple question: how can I center an object between two guides or between a guide and the edge of the artboard?

    Chris,
    You may (Smart Guides are your friends):
    1) Create a rectangle between the two Guides or between the Guide and the Artboard edge, by ClickDragging with the Rectangle Tool from (the desired spot) on one to (the desired spot) on the other (Smart Guides say path/path or path/page when you are there);
    2) Select both the rectangle from 1) and the object, then Click the rectangle again, then use the relevant options in the Align palette.
    That should move your object to the centre in the direction(s) you choose.

  • How to find the phase difference between two signals using Hilbert transform

    hi, 
        I am new to LabView.... I am trying to find phase difference between two signals. I sucessfuly found out the phase difference between two predefined waves using single tone measurement. .... But I really want to know how can I measure phase difference between two signals( not predefined... ie we don't know the initial conditions) using hilbert transform or any transformation techniques (without using zero cross detection).. I tried by using hilbert transform based on algorithm... bt I am getting error.... plz help me
    Attachments:
    phase_differece.vi ‏66 KB

    you could try something similar to this, for each table pair that you want to compare:
    SELECT 'TABLE_A has these columns that are not in TABLE_B', DIFF.*
      FROM (
            SELECT  COLUMN_NAME, DATA_TYPE, DATA_LENGTH
              FROM all_tab_columns
             WHERE table_name = 'TABLE_A'
             MINUS
            SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
              FROM all_tab_columns
             WHERE table_name = 'TABLE_B'
          ) DIFF
    UNION
    SELECT 'TABLE_B has these columns that are not in TABLE_A', DIFF.*
      FROM (
            SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
              FROM all_tab_columns
             WHERE table_name = 'TABLE_B'
             MINUS
            SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
              FROM all_tab_columns
             WHERE table_name = 'TABLE_A'
          ) DIFF;that's assuming, column_name, data_type and data_length are all you want to compare on.

  • How to SIMPLY add audio crossfade between two clips ?

    Tried to make a simple cut edit for tv news.
    How to add an audio crossfade between two clips to soften transition ?
    Detach audio, then create audio only scenario, then add transition ? Unusable.
    When importing 8 tracks from Xdcam HD, how do you choose wich audio track to add your transition to ?
    Also, impossible to re-export to Xdcam disk on the field.
    This piece of software is simply unusable in real life pro conditions. Some very nice features, globally a disaster.

    First thank you all for taking time to reply.
    I found these solutions myself but for me these are only workaround.
    In Fcp7, you just had to drag and drop dissolve transition to clips junctions TO AUDIO TRACK ONLY. Very quick and simple. In Fcpx, it is very time consuming if you want to add audio crossfade to every clip junction in a full project. That's really not a software evolution in my opinion...
    I think "easy transitions to audio tracks only" has to be implemented in next version.
    Thanks again !

  • How to calculate the hour difference between two dates?

    hi all,
    how to calculate the hour difference between two dates?
    eg i trying this...
    ((TO_DATE(TO_CHAR(GRNi.reference_date_4,'hh24:mi'),'hh24:mi') -
    TO_DATE(TO_CHAR(NVL(GRNi.reference_date_3,SYSDATE),'hh24:mi'),'hh24:mi'))*24)*60 Act_Hr
    Reg.
    AAK

    Hi
    To break the diff between 2 dates into days, hours, minutes, sec -- you can use the following:
    select to_char( created, 'dd-mon-yyyy hh24:mi:ss' ),
    trunc( sysdate-created ) "Dy",
    trunc( mod( (sysdate-created)*24, 24 ) ) "Hr",
    trunc( mod( (sysdate-created)*24*60, 60 ) ) "Mi",
    trunc( mod( (sysdate-created)*24*60*60, 60 ) ) "Sec",
    to_char( sysdate, 'dd-mon-yyyy hh24:mi:ss' ),
    sysdate-created "Tdy",
    (sysdate-created)*24 "Thr",
    (sysdate-created)*24*60 "Tmi",
    (sysdate-created)*24*60*60 "Tsec"
    from all_users
    where rownum < 50
    HTH
    RangaReddy

  • How do you sync the calendars between two ipads?

    How do you sync the calendars between two ipads?

    You can enable iCloud syncing on both devices, making sure hte calendar is part of the 'on' part and then what you change on one should change on the other too.

  • HT1449 how do you move all music from two computers into one itunes account?

    How do you move all music from two computers into one itunes account?

    An "iTunes account" is an online account you use for buying music, like a bank account.  An iTunes collection is the media you see when you open iTunes. Which do you mean?
    If it is two computers, it would also help to know where these are located. Are they on the same local network? If they are, try Home Sharing (and you have control of both and you aren't just trying to get music fro your computer to your friend's computer in another state).  If they are not, you'll have to use an external hard drive or flash drive.
    Is this on a PC? Your computer information says Windows but you posted this in the iTunes for Mac forum.

  • How to Calculate number of months between two dates

    Hi All,
       In one of the fomr developments, I have to calculate the
    Number of Days
    Number of Months ( Considering Leap Year) provided by the dates, end user enters in the form,
    After going thorugh some forum discussion, I have come to know about so many things which were not clear till now.
    I have gone through various forums too,  some one suggets to make use of FORM CALC and some other JAVA SCRIPT. But the logic i want to build in java script.
    The most interesting point is the DATE object is not getting created when i write  the below code
      var startDate = new DATE(oYear, oMonth, oDay);
    I am still not clear, that really the date object gets created in Adobe form If so the why the alert box is getting populated when i write below lines
    var oTemp = startDate.getFullYear();
    xfa.host.messagebox(oTemp);
    So, there are so many unclear things,
    If any one can help me by suggesting the approach and how to build the logic in the JavaScript I would be really thankful
    Regards
    PavanChand

    Hi,
    ChakravarthyDBA wrote:
    Hi
    I want number of Sundays between two dates
    example
    number of Sundays count between '01-04-2013' and '30-04-2013' in one select query I have to include this as sub query in my select statement.Here's one way:
    SELECT       early_date
    ,       late_date
    ,       ( TRUNC (late_date + 1, 'IW')
           - TRUNC (early_date,        'IW')
           ) / 7       AS sundays
    FROM       table_x
    ;This does not depend on your NLS settings.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
    Point out where the statment above is getting the wrong results, and explain, using specific examples, how you get the right results from the given data in those places.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • How to calculate the month difference between two date char. in Query?

    Customers would like to see how many months passed between two date type of characteristics (e.g., the month difference between the current date and the scheduled delivery date in the record) and put the result into the column as KF. 
    We would have to grab the fiscal year/period kind of value and then do the subtraction, e.g., if the current date value is 2/28/2008 and the scheduled delivery date value in the record is 12/01/2007, the correct result should be 2 month difference between these two date values, but could someone here give us the technical light on how to make this happen in query design?
    Thanks and we will give you reward points for the correct anwsers!

    Hi Kevin,
    The Badi is RSR_OLAP_BADI.
    You can create an implementation using Transaction  SE18.
    The implementation is per cube and is defined in the filters.
    In the Implementation you have the following methods :
    1. Define : Here you will provide the Keyfigure you need as a virtual one.
    2. Initilialize : Any Init Function you want to do.
    3. Compute. This is called per datarecord and here you can cimpute your value.
    Hope this helps.
    Pralay Ahluwalia

Maybe you are looking for

  • Error in Running my  Hibenate Program.............

    hi dudes........ I am new to hibernate.......I have some errors in while Running my program using Ecllipse.. */****Table/****** create table student(sno number(20),sname varchar(20),mobile number(10),email varchar(20)); Table created. *//****POJO cla

  • Some applications are blurry

    I have a Dell Inspiron 15 7547 and when I open some applications, usually games, they are blurry. I already tried going to properties>compatibility, but the compatibility tab is missing for one of my applications so it remains blurry. The other ones

  • What do I download to Install BI 7.0

    Hi Gurus, I saw the netweaver sneak previews but i do not know which one to download, what i want is an application that will make me pratice BW or BI 7.0, i saw SAP NetWeaver 2004s Java Trial Version, Full Java Edition-Trial, Developer Workplace - T

  • Multiple rollovers in one project

    Hello! I am working on a project that requires multiple rollovers and I cannot determine the best way to do what I want it to. I want to be able to rollover a shape and have a text box appear as well as lines connecting other dots. Then, as the lines

  • 12 core system prefs not saving settings??

    Got a new 12 core a couple of days ago but I when I change my setting...i.e. for the sound to play out of my external speakers, I have to let it to line out every time I boot the machine again. Anyone else experiencing this? Any ideas why? Thanks all