Posts by FreddyKrueger

    While I run my code the following message keeps popping up when I try to copy and paste a range.
    "Do you want to raplace contens of destination cells"
    How can this be avoided


    Here is part of my code:



    Edit: WillR. Freddy - Please use the code tags so that your code is easier to read. I have amended the code above. Thanks.

    I hope this will make sense
    I have a huge spreadsheet.
    The second column can contain one of say 10 diffirent funds (eg: "EB IF" or "EB NB" or "DLIF"). My first move is to sort this spreadsheet based on the column.


    My previous procedure used a for loop that looked at all the values in the second column (from row 1 to the last row that contains data) one by one and if they matched a certain input (eg "EB IF") the whole row were pasted to another sheet. :
    This is part of what I had



    This takes way too long too execute.
    I want to paste the whole range at once (Eg: All the "EB IF" consecutive values). Thus I want the "m" forloop to find the first valued, count the number of consecutive values and based on that copy and paste the required range.


    Please Help


    Edit: WillR: Freddy, Please use the code tags when posting code. I have edited the above (2nd post of yours today). Reasons...
    1. It saves me a job
    2. It makes reading the code easier.
    Please can you take the trouble to learn how to use the tags & use them in future. There is a TEST AREA for this purpose. Thankyou.

    I would like to do a loop equal to the number of rows that is not empty in my workbook.


    What the code does is it looks for a value in the second column of the workbook and if it exits, it copies the whole row and pastes it onto another workbook, row by row.


    My problem is that my original workbook may be anything from 25 to 2000 rows long but I do not want my loop to execute 2000 times each time it runs.
    How can I count the number of nonempty rows and only let my loop execute that number of times.


    This is my first post. Any help would be hugely appreciated


    F