Consulting

Results 1 to 4 of 4

Thread: Solved: Paste to latest empty cell

  1. #1
    VBAX Mentor
    Joined
    Feb 2012
    Posts
    406
    Location

    Question Solved: Paste to latest empty cell

    I have a VBA Code and i want to paste the data to latest blank cell of another sheet :

    that mean in column B in sheet 2 i have some data and now i want to copy data from sheet 1 to latest blank column of sheet 2 on column B .

    PHP Code:
     
        With Sheets
    ("sheet1")
            .
    Range(.Range("B1"), .Range("B65536").End(xlUp)).Copy
        End With
        Sheets
    ("sheet2").[B65536].End(xlUp)(1).PasteSpecial Paste:=xlValues 

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Last blank column or last blank row in column B. Your explanation is jumbled, and what is the deal with that code, it works or it doesn't work?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Mentor
    Joined
    Feb 2012
    Posts
    406
    Location
    I want to copy to latest blank cell on column B .

    and my code just copy to another column but do not copy to latest blank cell of another sheet .

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    With Worksheets("sheet1")
    .Range(.Range("B1"), .Cells(.Rows.count, "B").End(xlUp)).Copy
    End With
    With Worksheets("sheet2")
    .Cells(.Rows.count, "B").End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlValues
    End With
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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