+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    07-09-2008
    Location
    UK
    Posts
    20

    Find first empty row and paste into it

    Hey guys,

    I am trying to copy a selection (B13:B21) from one sheet called 'horizontal full list' and paste it into 'sheet1' into the first blank cell in column B from cell B15 onwards. The code I am trying to use is:

    Code:
       Sheets("Horizontal Full List").Range("B13:B21").Copy
       Sheets("Sheet1").Cells(Rows.Count, "B").End(xlUp).Paste
    But this is getting errors & I know it isn't complete i.e. to paste from cell B15 onwards.

    Could anybody offer me any help with getting this sorted?!

    Thanks,
    Alex

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    3,714
    You could do it like so:
    Code:
    Dim a As Long
    a = WorksheetFunction.Max(15, Sheets("Sheet1").Cells(Rows.Count, "B").End(xlUp).Row + 1)
    Sheets("Horizontal Full List").Range("B13:B21").Copy Sheets("Sheet1").Cells(a, "B")

  3. #3
    Registered User
    Join Date
    07-09-2008
    Location
    UK
    Posts
    20
    Thanks Stephen, that works perfectly!!

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.2.0