Help with Excel Applescript - deleting rows

Hi,
I'd like to delete all the rows that contain about 10 to 12 three letter combinations such as EDM, WAS, PIT, NYI and so on. All those three letter combinations are in one column of my spreadsheet (Column C).
Simon

Perhaps you can use this as starting point:
Sub Transform()
Dim wshS As Worksheet
Dim wbkT As Workbook
Dim wshT As Worksheet
Dim r As Long
Dim m As Long
Application.ScreenUpdating = False
Set wshS = ActiveSheet
m = wshS.Range("A" & wshS.Rows.Count).End(xlUp).Row
Set wbkT = Workbooks.Add(xlWBATWorksheet)
Set wshT = wbkT.Worksheets(1)
wshT.Range("A1") = "bgroup"
wshT.Range("B1") = "verses"
wshT.Range("A2") = "Default"
For r = 2 To m
wshT.Cells(2, r) = wshS.Cells(r, 1) & "." & wshS.Cells(r, 2) & _
"." & wshS.Cells(r, 3)
Next r
Application.Dialogs(xlDialogSaveAs).Show
Application.ScreenUpdating = True
End Sub
Regards, Hans Vogelaar (http://www.eileenslounge.com)

Similar Messages

  • How can I implement the equivilent of a temporary table with "on commit delete rows"?

    hi,
    I have triggers on several tables. During a transaction, I need to gather information from all of them, and once one of the triggers has all the information, it creates some data. I Can't rely on the order of the triggers.
    In Oracle and DB2, I'm using temporary tables with "ON COMMIT DELETE ROWS" to gather the information - They fit perfectly to the situation since I don't want any information to be passed between different transactions.
    In SQL Server, there are local temporary tables and global.  Local temp tables don't work for me since apparently they get deleted at the end of the trigger. Global tables keep the data between transactions.
    I could use global tables and add some field that identifies the transaction, and in each access to these tables join by this field, but didn't find how to get some unique identifier for the transaction. @@SPID is the session, and sys.dm_tran_current_transaction
    is not accessible by the user I'm supposed to work with.
    Also with global tables, I can't just wipe data when "operation is done" since at the triggers level I cannot identify when the operation was done, transaction was committed and no other triggers are expected to fire.
    Any idea which construct I could use to acheive the above - passing information between different triggers in the same transaction, while keeping the data visible to the current transaction?
    (I saw similar questions but didn't see an adequate answer, sorry if posting something that was already asked).
    Thanks!

    This is the scenario: If changes (CRUD) happen to both TableA and TableB, then log some info to TableC. Logic looks something like this:
    Create Trigger TableA_C After Insert on TableA {
      If info in temp tables available from TableB
            Write info to TableC
       else
           Write to temp tables info from TableA
    Create Trigger TableB_C After Insert on TableB {
      If info in temp tables available from TableA
            Write info to TableC
       else
           Write to temp tables info from TableB
    So each trigger needs info from the other table, and once everything is available, info to TableC is written. Info is only from the current transaction.
    Order of the triggers is not defined. Also there's no gurantee that both triggers would fire - changes can happen only to TableA / B and in that case I don't want to write anything to TableC.
    The part that gets and sets info to temp table is implemented as temp tables with "on commit delete rows" in DB2 / Oracle.
    What do you think? As I've mentioned, I could use global temp tables with a field that would identify the transaction, but didn't find something like that in SQL Server. And, the lifespan of local temp tables is too short.

  • Help with Simple Applescript for Midipipe

    Hey all, I'm in desperate need of help with some Applescript for use in a program called Midipipe:
    http://web.mac.com/nicowald/SubtleSoft/MidiPipe.html
    I simply require an Applescript for Midipipe that filters out all OFF notes except for the most recently pressed key, or most recently pressed ON note. So for example, when multiple keys have been pressed, only the most recently pressed key will send an OFF note. I hope that is clear enough, i've had some major issues trying to get this work and my last hope is to hit the forums and find some help .. I've posted on some of the audio forums and i'm hoping someone here knows how to code this.
    Thanks so much!! .. Its for an upcomming show next week so i'm hoping someone can get me in the right direction to solving this.
    -Jes

    I try to help, but you'll need to apply your brain cells to get it working with what I've already explained (three times with what I offer below).  Try something like the following (I am renaming your buttons to ch1,ch2,ch3,ch4,ch5,ch6 so that the same functions can be shared by all buttons...
    // this assigns listeners to all 6 buttons
    for(var i:uint=1; i<7; i++){
              this["ch"+String(i)].addEventListener(MouseEvent.CLICK, fl_ClickToSeekToCuePoint);
    // this processes any one of the 6 btns when they are clicked
    function fl_ClickToSeekToCuePoint_1(event:MouseEvent):void
        var btn = event.currentTarget;
        var cuePointInstance:Object = vid.findCuePoint(btn.name);
        vid.seek(cuePointInstance.time);
       resetButtons();    // this makes all buttons go back to normal
        btn.upState = btn.overState; // this makes the clicked button change states
    function resetButtons():void {
         for(var i:uint=1; i<7; i++){
              this["ch"+String(i)].upState =  this["ch"+String(i)].hitTestState;
    For this to work, your buttons need to have the same artwork in the hit frame as they do in the up frame.

  • Help with excel macros

    Good morning:
    I need help with a macro that let me solve the following situation:
    1. I have an excel file with the following format:
    Book
    Chapter
    Verse
    60
    5
    7
    43
    14
    1
    50
    4
    6
    50
    4
    7
    51
    3
    15
    23
    26
    3
    2. First I want to convert the file to this format:
    60.5.7
    43.14.1
    50.4.6
    50.4.7
    51.3.15
    23.26.3
    3. And finally to export them to a file called Bookmarks.xls with the format:
    bgroup
    verses
    Default
    60.5.7, 43.14.1, 50.4.6, 50.4.7, 51.3.15, 23.26.3
    I have some 40 files that need to be converted. All have the same format but the number of rows varies. By the way I am using Excel 10.
    Your help with this matter will be greatly appreciated.

    Perhaps you can use this as starting point:
    Sub Transform()
    Dim wshS As Worksheet
    Dim wbkT As Workbook
    Dim wshT As Worksheet
    Dim r As Long
    Dim m As Long
    Application.ScreenUpdating = False
    Set wshS = ActiveSheet
    m = wshS.Range("A" & wshS.Rows.Count).End(xlUp).Row
    Set wbkT = Workbooks.Add(xlWBATWorksheet)
    Set wshT = wbkT.Worksheets(1)
    wshT.Range("A1") = "bgroup"
    wshT.Range("B1") = "verses"
    wshT.Range("A2") = "Default"
    For r = 2 To m
    wshT.Cells(2, r) = wshS.Cells(r, 1) & "." & wshS.Cells(r, 2) & _
    "." & wshS.Cells(r, 3)
    Next r
    Application.Dialogs(xlDialogSaveAs).Show
    Application.ScreenUpdating = True
    End Sub
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Problem with creating and deleting row in table

    Hi
    I'm using JDev11.1.1.2.0. I have a table "A" with primary key X -> CHAR(1). I have created Entity and ViewObject (with the primary key X).
    I created an editable Table with CreateInsert and Delete actions.
    When I click Insert, a new record is added and I enter some data. Then I move selection to some other row, and return back to the new row. When I press Delete, It does not delete the new row, but the previous one selected.
    In the console, when I navigate back two the new added record: <FacesCtrlHierBinding$FacesModel><makeCurrent> ADFv: No row found for rowKey: [oracle.jbo.Key[null ]].
    I tried the same scenario with a different table, that has RowID as a primary key and it works correctly.
    Any Idea why this is happening ? I suppose it's connected somehow with the primary key.
    Thanks
    agruev
    Edited by: a.gruev on Nov 26, 2009 9:47 AM

    I changed my entity: unchecked the X column to be primary key added RowID as a primary key. Now it works.
    What's wrong with my CHAR(1) as a primary key ?
    I also tried to add a Refresh button:
      <af:commandButton text="Refresh" id="cb3"/>and in the table add a partialTarget to the button. Now when I add new row and press the Refresh button - then it works.
    So it seems that the problem is when I add new row and enter data, the table is not refreshed and the row is missing it's primary key.
    Any solutions?
    Edited by: a.gruev on Nov 26, 2009 4:18 PM

  • Help with excel output.

    How can I get the out with Excel format.  Here is the steps and output desire.
    The trick is I want the excel out put with specific format date, I have tried using SSIS 2012 for several days and it did not work.  The file must be in this format.  I google and try several examples but it failed.  Here is my codes below. 
    Any help is greatly appreciate.
    I have to schedule the job to run each night and output Excel file with date format below.
    date format: DDMMYY append to the file.
    Daily_Report_280115.csv or Daily_Report_280115.xlsx
    IF OBJECT_ID('dbo.usp_RptGetUserLogin', 'p') IS NOT NULL
      DROP PROCedure dbo.usp_RptGetUserLogin
    GO
    CREATE PROCedure dbo.usp_RptGetUserLogin
    @DBName     VARCHAR(40)
    AS
    **      Description: 
    **       Written by:
    **     Written date:  01/23/2015
    **    Modifications:
    **    ------------+---------------+-------------------------------------------
    **    Date:       |  Author:      |   Reasons:
    SET NOCOUNT ON;
    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
    DECLARE @SQLStr  VARCHAR(8000)
           ,@crlf        CHAR(1) = CHAR(13) + CHAR(10) -- carriage return, new line.
         --INSERT dbo.#AuditUserLogin (LoginId, DBName, UserName, UserOrAlias)
            --PRINT '-- go 2.'
            SET @SQLStr = 'USE ' + @DBName + ';' + @crlf + 'SELECT CAST(p1.name  AS VARCHAR(40)) AS [LoginName],
                CAST(db_name() AS VARCHAR(40)) AS [DBName],
                CAST(p.name AS VARCHAR(40)) AS [UserName],
                CAST(CASE
                  WHEN (p.is_fixed_role = 1) THEN ''MemberOf''  -- 1 = in one of the DB role.
                  ELSE ''User''
                END AS VARCHAR(20) ) AS [UserOrAlias]
           FROM sys.database_role_members AS r
           JOIN sys.database_principals AS p
             ON (r.role_principal_id = p.principal_id)
           JOIN sys.database_principals AS p1
             ON (r.member_principal_id = p1.principal_id)
          --WHERE (r.member_principal_id > 1) -- Exclusive dbo user.
       ORDER BY p1.name ASC, p.name ASC;'
       PRINT @SQLStr
       EXECute (@SQLStr)
    GO
    DECLARE @SQLString VARCHAR(5000)
           ,@sToday CHAR(6) =  REPLACE(CONVERT(VARCHAR(10), GETDATE(), 3), '/', '')
    SELECT @sToday
    SET @SQLString = 'OSQL /E -w2000 /d DBAMaintenance /S. ' + '/Q"EXECute dbo.usp_RptGetUserLogin @DBName = ''Dev''' + '" /o C:\ExcelOutPut\' + 'Daily_Report_' + RTRIM(@sToday) + '.csv'
    SELECT @SQLString
    --OSQL /E -w2000 /d DBAMaintenance /S. /Q"EXECute dbo.usp_RptGetUserLogin @DBName = 'Dev'" /o C:\ExcelOutPut\Daily_Report_280115.csv
    --EXECute Master..xp_cmdshell @SQLString
    -- Desired output:
    LoginName               DBName UserName       UserOrAlias
    dbo                     Dev       db_owner       MemberOf
    MyDomain\QA_ReadOnly_DB   Dev       db_datareader MemberOf
    MyDomain\Dev_ReadOnly_DB  Dev       db_datareader MemberOf
    MyDomain\languyen         Dev       db_datareader MemberOf
    MyDomain\languyen         Dev       db_datawriter MemberOf
    Lam                     Dev       db_backupoperator MemberOf
    Lam                     Dev       db_datareader MemberOf
    Lam                     Dev       db_datawriter MemberOf

    You try using BCP
    https://www.simple-talk.com/sql/database-administration/creating-csv-files-using-bcp-and-stored-procedures/
    BTW, Are you using SQL 2000?
    Also you can try with Powershell
    https://gallery.technet.microsoft.com/PowerShell-Export-SQL-Data-67bcb690
    --Prashanth

  • Help with Excel, please

    Would be very grateful for help with my Excel spreadsheet.
    My workbook contains 20 or so worksheets. I was trying to copy column totals across a particular sheet when it disappeared. After trying to find the missing sheet, called 'Jan 2011', and giving up, I decided as a last resort to re-create the worksheet. However, after inserting a new sheet and trying to re-name it 'Jan 2011', I get the error message that this sheet name already exists. Does anyone have any ideas on where it might be? Many thanks

    You need to post over on the Microsoft Office for Mac forums.  Google will help you find them.

  • Help with excel formula

    hi,
    I need help with some excel fomulas,  I have a source file which 2 cells will continually change, I want to link this source file to an inventory file and update the information on seperate lines when the information is changed without changing the
    destination information
    is it possible or do I have to create seperate source file

    Hi,
    According to your description, my understanding is that you have 2 files (A source file and an inventory file) and link the source file to inventory file. You want to retain the data in the inventory file when the source file continually change.
    If it is, there is no formula will retain the linked data after the data source changed.
    We may try the workarounds:
    1. Use import data from source file to the inventory file.
    2. Create seperate source file
    If I misunderstand, please let me know and share us more information about your demand.
    Regards,
    George Zhao
    TechNet Community Support

  • Need help with first applescript@Quicktime- can't figure out a few lines...

    Ok guys I need help, here is what I want to happen. I want the script to just shorten a movie file. It should be so simple!!
    lengthofmovie = film length
    set time range from 0 to (lengthofmovie-1)
    save the movie as a new file
    That is all I want done, I am ripping my hair out of my head trying to do this. Please help me!!
    Here is my code so far:
    with timeout of 86400 seconds
    display dialog "Before beginning batch processing, make sure QuickTime Player is set to the desired export settings, and all videos to be processed are in a folder named ‘Input’ on the desktop." with icon note
    tell application "Finder"
    set the startup_disk to the name of the startup disk
    end tell
    set user to do shell script "whoami"
    set inputfoldername to "Input"
    set input_folder to startup_disk & ":Users:" & user & ":Desktop:" & inputfoldername & ":"
    set user_desktop to startup_disk & ":Users:" & user & ":Desktop:"
    set output_folder to startup_disk & ":Users:" & user & ":Desktop:Output:"
    set file_extension to "_export.mp4"
    try
    tell application "Finder"
    make new folder at user_desktop with properties {name:"Output"}
    end tell
    end try
    try
    set thefolderlist to list folder input_folder without invisibles
    repeat with x from 1 to count of thefolderlist
    set the_file to input_folder & item x of thefolderlist
    set output_file to output_folder & item x of thefolderlist & file_extension
    tell application "QuickTime Player"
    activate
    open the_file
    //change timeline, trim NEED HELP HERE
    export front document to output_file as MPEG4 using most recent settings with replacing
    close front document
    end tell
    end repeat
    on error
    display dialog "This script requires a folder named ‘" & inputfoldername & "‘ located on the desktop." with icon stop
    end try
    beep
    end timeout

    Hi plashd,
    First, I must confess that I don't know much about QuickTime. Nevertheless, while trying to understand your problem, I discovered that the AppleScript dictionaries of QuickTime Player and QuickTime 7 were very different from one another, and was unable to use the “export” command of QuickTime Player. However, I finally was able, with the following script, to use AppleScript to shorten a QuickTime movie and save it under another name:
    *set the_file to POSIX file "/Users/pierre/Desktop/MVI_0503.MOV"*
    *set output_file to "/Users/pierre/Desktop/NewMVI0503.MOV"*
    *tell application "QuickTime Player"*
    activate
    *open the_file*
    *tell front document*
    *trim from 1 to (duration - 5)*
    *save in output_file with replacing*
    *close without saving*
    *end tell*
    *end tell*
    Hope it can help.

  • Help with PowerShell to delete a date range of Calendar meetings

    I'm trying to delete all Calendar items within a date range, from a mailbox. But first I'd like to just make sure my date filter is actually working.
    Here is what i HAVE working:
    Search-Mailbox ME -SearchQuery "Received:01/01/2010..03/18/2010" -EstimateResultOnly
    This works, it gives me a count of all things in my mailbox
    Search-Mailbox ME -SearchQuery kind:meetings -EstimateResultOnly
    This works, it gives me a count of all Meetings in my Calendar.
    I reallly need now to get the date range to work in conjunction with the kind:meetings.
    How can I do that?

    Hi,
    The results include the deleted meetings. I test it in my lab.
    So the command to delete Calendar meetings with a date range is this:
    Search-Mailbox "username" -SearchQuery "Received:01/01/2010..3/18/2015 kind:meetings" –EstimateResultOnly -DeleteContent
    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]
    Lynn-Li
    TechNet Community Support

  • Please help with troubleshooting Applescript invoked by Apple Mail rule

    I set up an account with Boxcar to get push notification of incoming email on my iPhone. I did this because I passworded my iPhone and cannot see incoming messages without entering the password. Now all I need to do is glance at the screen to see whether it's worth it or not to look at the email. In order to use the Boxcar service, I needed to set up a rule to redirect all incoming mail to my private address on Boxcar. The issues that I have are two-fold. First, I do not like blindly forwarding email content to Boxcar regardless of their stated claim that they strip out the sender and subject of a message and discard the rest. Second, if I get a large incoming email, then My method will have to send the large content out again - a waste of resources. To get around this, I tried to write an Applescript for Apple Mail that is invoked by a rule applicable to all messages. The script redirects all messages to my private Boxcar email address and strips out the content of the message. The script follows:
    using terms from application "Mail"
    on perform mail action with messages selectedMessages
    set AppleScript's text item delimiters to ""
    repeat with theMessage in selectedMessages
    set boxcarMessage to redirect theMessage
    tell boxcarMessage
    make new to recipient at beginning of to recipients with properties {address:"[email protected]"}
    set content to " "
    set subject to theMessage's subject
    end tell
    send boxcarMessage
    end repeat
    end perform mail action with messages
    end using terms from
    The problem with this script is that it still sends out the content even though I thought I was setting it to a single space. Other than that, it does just what I need it to do. Any suggestions on corrections, an easier Applescript, or another way to approach the whole issue? One drawback to this approach is that I need to have a Mac running at home that processes the rule for the incoming messages - probably there is no way around this?
    Thanks!

    That makes sense, but then that gets back to your original comment:
    "redirecting the message will send the entire message, as-is."
    I tried to eliminate the attachments by adding the line:
    delete boxcarMessage's attachments
    but it did not work - the attachments were redirected also. So here is the script as it stands now:
    using terms from application "Mail"
    on perform mail action with messages selectedMessages
    set AppleScript's text item delimiters to ""
    repeat with theMessage in selectedMessages
    set boxcarMessage to redirect theMessage
    delete boxcarMessage's attachments
    tell boxcarMessage
    make new to recipient at beginning of to recipients with properties {address:"[email protected]"}
    end tell
    delay 3
    send boxcarMessage
    end repeat
    end perform mail action with messages
    end using terms from
    I appreciate the input. Intuitively it seems like this is doable, but the solution escapes me.

  • Help with a Before Delete Triggger

    Hello:
    When I do a delete operation on a table that has the following trigger, it comes up with an error message,
    ":ORA-04091: table INNOBOX.SUGGEST is mutating, trigger/function may not see it
    ORA-06512: at "INNOBOX.DELSUGGEST", line 44
    ORA-04088: error during execution of trigger 'INNOBOX.DELSUGGEST'"
    Can somebody tell me what I am doing wrong?
    CREATE OR REPLACE TRIGGER INNOBOX.delSuggest
    BEFORE DELETE
    ON INNOBOX.SUGGEST
         FOR EACH ROW
              BEGIN
                   INSERT INTO INNOBOX.SUGGEST_LOG
                        Sugg_Log_ID_N,
                        Sugg_No_N,
                        Cat_CD_C,
                        Liaison_CD_C,
                        S_Desc_C,
                        L_Desc_C,
                        S_Stat_CD_C,
                        S_Stat_DT,
                        Benefit_C,
                        Cost_Sav_C,
                        Resol_C,
                        D_Stat_CD_C,
                        D_Stat_DT,
                        ACD_CD_C,
                             Cr_By_ID_C,
                        Cr_DT,
                        Up_By_ID_C,
                        Up_DT     
                   VALUES
                             INNOBOX.Suggest_Log_Seq.NEXTVAL,
                        :old.Sugg_No_N,
                        :old.Cat_CD_C,
                        :old.Liaison_CD_C,
                        :old.S_Desc_C,
                        :old.L_Desc_C,
                        :old.S_Stat_CD_C,
                        :old.S_Stat_DT,
                        :old.Benefit_C,
                        :old.Cost_Sav_C,
                        :old.Resol_C,
                        :old.D_Stat_CD_C,
                             :old.D_Stat_DT,
                             'D',
                             :old.Cr_By_ID_C,
                             :old.Cr_DT,
                             :old.Up_By_ID_C,
                             :old.Up_DT
                   DELETE SUGGEST WHERE Sugg_No_N = :old.Sugg_No_N
              END;
    Thanks.
    Venki

    Hi,
    Try to remove the last line from your trigger :
    DELETE SUGGEST WHERE Sugg_No_N = :old.Sugg_No_N, you delete a line from a table for which there is the same before delete trigger, also there is a muttating trigger.
    HTH,
    Nicolas.

  • Help with Excel, ODBC and SQL

    I have an excel doc like this:
    A B C D E
    1 q w e r t
    2 t e s t
    3 s u p e r
    4
    5
    I have made the connection but I have problems with printing out the values. Could anybody give me a hint or 2
    Fore example how do I print out D3???? Or row 2???
    BR Soren

    you should check this article out :
    http://www.javaworld.com/javaworld/javaqa/2001-06/04-qa-0629-excel.html

  • Help with excel grouped data and sorting to keep data intact

    I have a master spreadsheet with lots of data. I am trying to grouped the data based on physical address/city, add the values and once done sort it by valuation based on descending order by valuation but my data keep messing up.
    So in Row 1/col A: Address 1; Col B City: XXX; Col C: Valuation $$$
    Row 2/col A: Address 1; Col B City: XXX; Col C: Vauation $$$
    Row 3/col A: Address 2; COl B City: YYY; Col C:  Valuation $$$
    SO I sort by city and in ROw 1/2 same city with same address, I grouped it.  THen I created a new row below Row 3 and add up the grouped data (i.e. ROw 1 and 2).  I go through the entire list to finalize the grouped locations.  
    But when I am done and I sort by Valuation, all my data messed up coz I created a new row with addition of grouped location valuation and the formula gets messed up.
    Any one with ideas please help.  My deadline for this project is just a week away and I am freaking out.
    THanks in advance.

    it seems upload a sample is more clearly about the required.
    KR

  • Help with excel document

    hello all,
    I have an excel base `database`on which I have been working on for about 10 years. It basically has all my music data from all this time, i.e. it is very important for me.
    I keep a copy on my Palm TX in case I need to make notes on the go, and I syncronize with the dataviz documents to go application.
    Today during sync, the process unexpectedly stopped, and now I cant seem to open the file. I double click, excel starts, but no open.
    Anyone might have any idea what caused this? If anyone can help I am willing to send the file for revision-correction.
    thanks all

    By the way, when I move the file to a PC and try to open it, I get the following message
    éxcel caused an error in MS097.dll. Excel will close
    Help!
    J

Maybe you are looking for

  • Jabber 9.2.7 and CUCM 9.1 Directory Profile

    Hi Does jabber 9.2.7 uses Directory UC services on CUCM 9.1 for directory Search?. I have configure but it does not seems to work, data does not show on the "show connection status" of the Cisco Jabber Client.

  • Difficulty with SELECTING proper VIDEO CLIP within MOTION3.

    Hi all. I'm editing in fcp and want to create smooth slo-mo's in Motion 3. In my fcp sequence I highlight my clip and "send to Motion"... Motion opens with the clip in the viewer. Under the inspector tab I go to timing --> in frame blending I select

  • Change HTTP Basic authetication credentials at runtime

    We are implementing REST in ALSB. But the web application we are using requires basic authentication. For this we are configuring static service account in buesiness service. Now based on input parameter I need to change the relative uri and user id

  • Multi window apps

    Isn't there a way to include other apps as part of the multi window menu?.  It would be nice to refer to my calendar while in another window

  • Unable to make changes after upgrading to the latest version.

    I upgraded to the latest version (6) and I am still able to upload to my ftp but no changes actually take place on my site www.professional-liar.com