+ Reply to Thread
Results 1 to 7 of 7

Paste values in VB

  1. #1
    Alex Martins
    Guest

    Paste values in VB

    Hi I need some help with the pastevalues for this, which isn't pasting
    values...:
    Sub UpdateBD1()
    Sheets("NEW").Range("K12:O12").Copy Destination:= _
    Sheets("BD1").Range("C5").End(xlDown) _
    .Offset(1, 0)
    End Sub

    I thank you in advance for your help.

    Alex

  2. #2
    Forum Contributor kraljb's Avatar
    Join Date
    05-26-2004
    Location
    Illinois
    MS-Off Ver
    2007 (recent change)
    Posts
    256
    Sheets("NEW").Range("K12:O12").Copy
    Sheets("BD1").Range("C5").End(xlDown).Offset(1, 0).PasteSpecial Paste:=xlPasteValues

    Hope that helps

  3. #3
    Tom Ogilvy
    Guest

    Re: Paste values in VB

    Sub UpdateBD1()
    Sheets("NEW").Range("K12:O12").Copy
    Sheets("BD1").Range("C5").End(xlDown) _
    .Offset(1, 0).PasteSpecial xlValues
    End Sub

    --
    Regards,
    Tom Ogilvy

    "Alex Martins" <[email protected]> wrote in message
    news:[email protected]...
    > Hi I need some help with the pastevalues for this, which isn't pasting
    > values...:
    > Sub UpdateBD1()
    > Sheets("NEW").Range("K12:O12").Copy Destination:= _
    > Sheets("BD1").Range("C5").End(xlDown) _
    > .Offset(1, 0)
    > End Sub
    >
    > I thank you in advance for your help.
    >
    > Alex




  4. #4
    Alex Martins
    Guest

    Re: Paste values in VB

    Hey Tom, thanks for all your help!

    This is giving me an error though...I copied what you sent and it says
    "application-defined or Object_defined error".

    Do you know what I might be doing wrong?

    Thanks again man.
    Alex


    "Tom Ogilvy" wrote:

    > Sub UpdateBD1()
    > Sheets("NEW").Range("K12:O12").Copy
    > Sheets("BD1").Range("C5").End(xlDown) _
    > .Offset(1, 0).PasteSpecial xlValues
    > End Sub
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Alex Martins" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi I need some help with the pastevalues for this, which isn't pasting
    > > values...:
    > > Sub UpdateBD1()
    > > Sheets("NEW").Range("K12:O12").Copy Destination:= _
    > > Sheets("BD1").Range("C5").End(xlDown) _
    > > .Offset(1, 0)
    > > End Sub
    > >
    > > I thank you in advance for your help.
    > >
    > > Alex

    >
    >
    >


  5. #5
    Alex Martins
    Guest

    Re: Paste values in VB

    Hey K...I couldn't make that work...thanks for the help. If you think of
    anything else please let me know.

    Thanks again for your help!
    Alex

    "kraljb" wrote:

    >
    > Sheets("NEW").Range("K12:O12").Copy
    > Sheets("BD1").Range("C5").End(xlDown).Offset(1, 0).PasteSpecial
    > Paste:=xlPasteValues
    >
    > Hope that helps
    >
    >
    > --
    > kraljb
    > ------------------------------------------------------------------------
    > kraljb's Profile: http://www.excelforum.com/member.php...fo&userid=9955
    > View this thread: http://www.excelforum.com/showthread...hreadid=400915
    >
    >


  6. #6
    Patti
    Guest

    Re: Paste values in VB

    Alex,

    On sheet BD1, do you have any data in column C in/after row 6? If not, that
    would cause the error.

    Both of the suggestions worked for me, although I did have to put a line
    continuation character (space underscore space) in this one after
    PasteSpecial:

    Sheets("NEW").Range("K12:O12").Copy
    Sheets("BD1").Range("C5").End(xlDown).Offset(1, 0).PasteSpecial _
    Paste:=xlPasteValues

    Regards,

    Patti



    "Alex Martins" <[email protected]> wrote in message
    news:[email protected]...
    > Hey K...I couldn't make that work...thanks for the help. If you think of
    > anything else please let me know.
    >
    > Thanks again for your help!
    > Alex
    >
    > "kraljb" wrote:
    >
    >>
    >> Sheets("NEW").Range("K12:O12").Copy
    >> Sheets("BD1").Range("C5").End(xlDown).Offset(1, 0).PasteSpecial
    >> Paste:=xlPasteValues
    >>
    >> Hope that helps
    >>
    >>
    >> --
    >> kraljb
    >> ------------------------------------------------------------------------
    >> kraljb's Profile:
    >> http://www.excelforum.com/member.php...fo&userid=9955
    >> View this thread:
    >> http://www.excelforum.com/showthread...hreadid=400915
    >>
    >>




  7. #7
    Tom Ogilvy
    Guest

    Re: Paste values in VB

    You would have that problem if there were all empty cells from C6 to the
    last cell in that column.

    You would have the same problem with your original code.


    Sub UpdateBD1()
    dim rng as Range
    set rng = sheets("BD1").range("C5")
    if not isempty(rng) then
    if isempty(rng.offset(1,0) then
    set rng = rng.offset(1,0)
    else
    set rng = rng.end(xldown)(2)
    end if
    Sheets("NEW").Range("K12:O12").Copy
    rng.PasteSpecial xlValues
    End Sub

    --
    Regards,
    Tom Ogilvy


    "Alex Martins" <[email protected]> wrote in message
    news:[email protected]...
    > Hey Tom, thanks for all your help!
    >
    > This is giving me an error though...I copied what you sent and it says
    > "application-defined or Object_defined error".
    >
    > Do you know what I might be doing wrong?
    >
    > Thanks again man.
    > Alex
    >
    >
    > "Tom Ogilvy" wrote:
    >
    > > Sub UpdateBD1()
    > > Sheets("NEW").Range("K12:O12").Copy
    > > Sheets("BD1").Range("C5").End(xlDown) _
    > > .Offset(1, 0).PasteSpecial xlValues
    > > End Sub
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > > "Alex Martins" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hi I need some help with the pastevalues for this, which isn't pasting
    > > > values...:
    > > > Sub UpdateBD1()
    > > > Sheets("NEW").Range("K12:O12").Copy Destination:= _
    > > > Sheets("BD1").Range("C5").End(xlDown) _
    > > > .Offset(1, 0)
    > > > End Sub
    > > >
    > > > I thank you in advance for your help.
    > > >
    > > > Alex

    > >
    > >
    > >




+ 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