+ Reply to Thread
Results 1 to 2 of 2

Copy Data to first empty column range and not row.

  1. #1
    Registered User
    Join Date
    03-01-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    2

    Copy Data to first empty column range and not row.

    Hi
    I have created a macro which copies data from sheet1 to sheet3, but i only want to copy the data on sheet3 from first empty column in column 'B' and not from 'A'. In my case, in sheet3 column 'A' contains serial numbers and i only want the data from sheet 1 to be copied to sheet 3 from first empty column B cell which would be empty but below code only copies data to first empty row rather than column.

    The scenario is in sheet3!ColumnA contains serial number and the data entered in Sheet1 should copy to sheet3 where the serial number doesn't belong any data so that the newly copied row would be associated to existing serial number.

    My code is as below:
    Worksheets("sheet3").Select
    Worksheets("sheet3").Range("B1").Select

    If Worksheets("Sheet3").Range("B1").Offset(RowCount, 1) <> "" Then
    Worksheets("sheet3").Range("B1").End(xlDown).Select
    MsgBox RowCount
    End If

    RowCount = Worksheets("Sheet3").Range("B1").CurrentRegion.Rows.Count

    With Worksheets("sheet3").Range("B1")
    .Offset(RowCount, 0) = ReqBy
    .Offset(RowCount, 1) = Dept
    .Offset(RowCount, 2) = AppBy
    End With

    Worksheets("sheet1").Select
    Worksheets("sheet1").Range("C8").Select

    ActiveWorkbook.Save


    Thanks in advance

    Fayz

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy Data to first empty column range and not row.

    Fayz ,
    Please wrap your code in code tags as per forum's rule.

    These lines are the only ones which are copying and that is even with in sheet3. Sheet1 only comes in to play during the end and that is to select it.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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