+ Reply to Thread
Results 1 to 7 of 7

Finding next blank row and pasting problem

  1. #1
    Registered User
    Join Date
    10-08-2008
    Location
    Hallandale
    Posts
    44

    Finding next blank row and pasting problem

    What I’m trying to do here is to auto filter everything and then filter column 4 for “20”
    Copy the filtered area to a “TR 53 Div” sheet and delete it from original “TR 53 Other” sheet.
    Next step is to do similar thing by filtering for “50” and copying it, but my problem is pasting it to a “TR 53 Div” sheet that already contains info for “20” and what I need to do is to find the next blank row in “TR 53 Div” sheet and paste “50”.

    So, the bottom line is that I need a formula that will find the next blank row in “TR 53 Div” sheet so that I’m able to paste the next thing.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Your code can be a made more efficient. It needs to only copy filtered rows, currently it will copy all rows.

    Attach an example workbook & state exactly what to filter, and where to copy to.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    10-08-2008
    Location
    Hallandale
    Posts
    44
    Please see attached
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    10-08-2008
    Location
    Hallandale
    Posts
    44
    Quote Originally Posted by koklok View Post
    Please see attached
    Anybody ???

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try this code

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-08-2008
    Location
    Hallandale
    Posts
    44
    Roy,

    Thanks for help but code only works in new workbook or the example
    However when I try using it in my actual workbook it doesn't work
    I'm little confused with your code because it doesn't refer to any of the sheets that are in example (ALL , or 20&50)
    I tried changing your code where it has sheet 1 or sheet 2 but it doesn't work, and I tried many changes but still nothing
    Any sugestions what I'm doing wrong?

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Have a look at the VB Editor and you will see the worksheets in the workbook listed in the Project Window at the left. In the example

    Sheet1(All)
    Sheet2(20 & 50")

    You can refer to sheets in code with

    Sheets("All") - this is the Sheet name and will fail if the sheet is renamed
    Sheets(1) - this is the sheet Index and will fail if the sheet is moved
    Sheet1, outside the brackets, is the code name & can only be changed by accessing the
    VB Editor. This is generally the best one to use

    Look at your workbook to get the code name

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1