how to control copy and paste from excel sheet using autohotkey?












0















I am copying and pasting some data from ms excel sheet to some other program using the following autohotkey script:



f1::
loop 2000
{
Send, {CTRLDOWN}c{CTRLUP}
sleep 100
send {ALTDOWN}{TAB}{ALTUP}
sleep 100
Send, {CTRLDOWN}v{CTRLUP}{enter}
sleep 100
send {ALTDOWN}{TAB}{ALTUP}
sleep 100
send {down}
}
return


There are more than 2000 entries in column a of an excel sheet which I have to copy and paste into some other program.



My problem is this that all those entries are in random cells i.e. there are so many cells blank in column a in excel sheet.



Is there any command in autohotkey to copy only those cells in which there is data and blank cells can be omitted?



Is it possible to delete all those rows (cells) which are blank in the excel sheet?



This a great solution of the problem suggested by SIDOLA



One more thing I wish to ask is that-
If the same problem is occurring while pasting then what should I do, namely I copied some data from excel sheet and if the same data already exist in the program where I wish to paste it then I want that it should escape the pasting of that data and should continue with the next copying. Kindly help..










share|improve this question

























  • Have you tried sorting the data in Excel? This will move the blanks cells to bottom

    – AEonAX
    Mar 30 '15 at 7:58


















0















I am copying and pasting some data from ms excel sheet to some other program using the following autohotkey script:



f1::
loop 2000
{
Send, {CTRLDOWN}c{CTRLUP}
sleep 100
send {ALTDOWN}{TAB}{ALTUP}
sleep 100
Send, {CTRLDOWN}v{CTRLUP}{enter}
sleep 100
send {ALTDOWN}{TAB}{ALTUP}
sleep 100
send {down}
}
return


There are more than 2000 entries in column a of an excel sheet which I have to copy and paste into some other program.



My problem is this that all those entries are in random cells i.e. there are so many cells blank in column a in excel sheet.



Is there any command in autohotkey to copy only those cells in which there is data and blank cells can be omitted?



Is it possible to delete all those rows (cells) which are blank in the excel sheet?



This a great solution of the problem suggested by SIDOLA



One more thing I wish to ask is that-
If the same problem is occurring while pasting then what should I do, namely I copied some data from excel sheet and if the same data already exist in the program where I wish to paste it then I want that it should escape the pasting of that data and should continue with the next copying. Kindly help..










share|improve this question

























  • Have you tried sorting the data in Excel? This will move the blanks cells to bottom

    – AEonAX
    Mar 30 '15 at 7:58
















0












0








0








I am copying and pasting some data from ms excel sheet to some other program using the following autohotkey script:



f1::
loop 2000
{
Send, {CTRLDOWN}c{CTRLUP}
sleep 100
send {ALTDOWN}{TAB}{ALTUP}
sleep 100
Send, {CTRLDOWN}v{CTRLUP}{enter}
sleep 100
send {ALTDOWN}{TAB}{ALTUP}
sleep 100
send {down}
}
return


There are more than 2000 entries in column a of an excel sheet which I have to copy and paste into some other program.



My problem is this that all those entries are in random cells i.e. there are so many cells blank in column a in excel sheet.



Is there any command in autohotkey to copy only those cells in which there is data and blank cells can be omitted?



Is it possible to delete all those rows (cells) which are blank in the excel sheet?



This a great solution of the problem suggested by SIDOLA



One more thing I wish to ask is that-
If the same problem is occurring while pasting then what should I do, namely I copied some data from excel sheet and if the same data already exist in the program where I wish to paste it then I want that it should escape the pasting of that data and should continue with the next copying. Kindly help..










share|improve this question
















I am copying and pasting some data from ms excel sheet to some other program using the following autohotkey script:



f1::
loop 2000
{
Send, {CTRLDOWN}c{CTRLUP}
sleep 100
send {ALTDOWN}{TAB}{ALTUP}
sleep 100
Send, {CTRLDOWN}v{CTRLUP}{enter}
sleep 100
send {ALTDOWN}{TAB}{ALTUP}
sleep 100
send {down}
}
return


There are more than 2000 entries in column a of an excel sheet which I have to copy and paste into some other program.



My problem is this that all those entries are in random cells i.e. there are so many cells blank in column a in excel sheet.



Is there any command in autohotkey to copy only those cells in which there is data and blank cells can be omitted?



Is it possible to delete all those rows (cells) which are blank in the excel sheet?



This a great solution of the problem suggested by SIDOLA



One more thing I wish to ask is that-
If the same problem is occurring while pasting then what should I do, namely I copied some data from excel sheet and if the same data already exist in the program where I wish to paste it then I want that it should escape the pasting of that data and should continue with the next copying. Kindly help..







autohotkey






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 30 '15 at 9:33







user432785

















asked Mar 30 '15 at 7:13









user432785user432785

14




14













  • Have you tried sorting the data in Excel? This will move the blanks cells to bottom

    – AEonAX
    Mar 30 '15 at 7:58





















  • Have you tried sorting the data in Excel? This will move the blanks cells to bottom

    – AEonAX
    Mar 30 '15 at 7:58



















Have you tried sorting the data in Excel? This will move the blanks cells to bottom

– AEonAX
Mar 30 '15 at 7:58







Have you tried sorting the data in Excel? This will move the blanks cells to bottom

– AEonAX
Mar 30 '15 at 7:58












1 Answer
1






active

oldest

votes


















0














You could try checking if the Clipboard variable is empty after sending Send, {CTRLDOWN}c{CTRLUP}. If it is, simply skip the rest of the flow and continue with the next row.



f1::
loop 2000
{
Send, {CTRLDOWN}c{CTRLUP}

; If nothing was copied, move down and start over
if (!Clipboard) {
Send, {down}
Continue
}

sleep 100
send {ALTDOWN}{TAB}{ALTUP}
sleep 100
Send, {CTRLDOWN}v{CTRLUP}{enter}
sleep 100
send {ALTDOWN}{TAB}{ALTUP}
sleep 100
send {down}
}
return





share|improve this answer
























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f895633%2fhow-to-control-copy-and-paste-from-excel-sheet-using-autohotkey%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You could try checking if the Clipboard variable is empty after sending Send, {CTRLDOWN}c{CTRLUP}. If it is, simply skip the rest of the flow and continue with the next row.



    f1::
    loop 2000
    {
    Send, {CTRLDOWN}c{CTRLUP}

    ; If nothing was copied, move down and start over
    if (!Clipboard) {
    Send, {down}
    Continue
    }

    sleep 100
    send {ALTDOWN}{TAB}{ALTUP}
    sleep 100
    Send, {CTRLDOWN}v{CTRLUP}{enter}
    sleep 100
    send {ALTDOWN}{TAB}{ALTUP}
    sleep 100
    send {down}
    }
    return





    share|improve this answer




























      0














      You could try checking if the Clipboard variable is empty after sending Send, {CTRLDOWN}c{CTRLUP}. If it is, simply skip the rest of the flow and continue with the next row.



      f1::
      loop 2000
      {
      Send, {CTRLDOWN}c{CTRLUP}

      ; If nothing was copied, move down and start over
      if (!Clipboard) {
      Send, {down}
      Continue
      }

      sleep 100
      send {ALTDOWN}{TAB}{ALTUP}
      sleep 100
      Send, {CTRLDOWN}v{CTRLUP}{enter}
      sleep 100
      send {ALTDOWN}{TAB}{ALTUP}
      sleep 100
      send {down}
      }
      return





      share|improve this answer


























        0












        0








        0







        You could try checking if the Clipboard variable is empty after sending Send, {CTRLDOWN}c{CTRLUP}. If it is, simply skip the rest of the flow and continue with the next row.



        f1::
        loop 2000
        {
        Send, {CTRLDOWN}c{CTRLUP}

        ; If nothing was copied, move down and start over
        if (!Clipboard) {
        Send, {down}
        Continue
        }

        sleep 100
        send {ALTDOWN}{TAB}{ALTUP}
        sleep 100
        Send, {CTRLDOWN}v{CTRLUP}{enter}
        sleep 100
        send {ALTDOWN}{TAB}{ALTUP}
        sleep 100
        send {down}
        }
        return





        share|improve this answer













        You could try checking if the Clipboard variable is empty after sending Send, {CTRLDOWN}c{CTRLUP}. If it is, simply skip the rest of the flow and continue with the next row.



        f1::
        loop 2000
        {
        Send, {CTRLDOWN}c{CTRLUP}

        ; If nothing was copied, move down and start over
        if (!Clipboard) {
        Send, {down}
        Continue
        }

        sleep 100
        send {ALTDOWN}{TAB}{ALTUP}
        sleep 100
        Send, {CTRLDOWN}v{CTRLUP}{enter}
        sleep 100
        send {ALTDOWN}{TAB}{ALTUP}
        sleep 100
        send {down}
        }
        return






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 30 '15 at 8:40









        SidolaSidola

        36125




        36125






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f895633%2fhow-to-control-copy-and-paste-from-excel-sheet-using-autohotkey%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How do I know what Microsoft account the skydrive app is syncing to?

            When does type information flow backwards in C++?

            Grease: Live!