+ Reply to Thread
Results 1 to 10 of 10

Pasting data onto Sheet

  1. #1
    Registered User
    Join Date
    01-18-2009
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    21

    Pasting data onto Sheet

    I am using 'Dim' to define a string for SheetName, a variable.

    I have tried with no success various ways to try and paste data to a sheet with this variable.
    I know the variable is correct as I am using it to make a new sheet then rename it and also move it.

    The code I have used I have edited several time but still with no luck.
    I have tried:

    Please Login or Register  to view this content.
    and also:
    Please Login or Register  to view this content.
    Still with no luck. I know I must be close but have searched this forum and found no similar answers.


    Any help would be really appreciated folks.

    Thanks.
    Last edited by davesexcel; 02-04-2009 at 07:04 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Pasting data onto Sheet

    You probably need to paste the row to a cell, not to a row

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Pasting data onto Sheet

    You can use either of these forms:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    01-18-2009
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Pasting data onto Sheet

    It still does not work. I am using a command button to run this code.

    It working correctly right up to the 'paste' line of code.

    Please Login or Register  to view this content.

    Cheers folks

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Pasting data onto Sheet

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-18-2009
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Pasting data onto Sheet

    Thanks for the reply.
    I have used the above code but nothing is being pasted into the destination sheet.

    What am I doing wrong? Its driving me mad because I feel sure I am close to solving it.

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Pasting data onto Sheet

    Try this
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    01-18-2009
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Pasting data onto Sheet

    Hi Dave,
    It works but copies everything from line 1 to 5 and not everything line 5 onwards.

    I have put in a 'MsgBox f' after the f = ws.Range......line to see what value of 'f' is being carried forward and it just says 1.

    Any ideas?

    Thanks

  9. #9
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Pasting data onto Sheet

    Quote Originally Posted by twosides View Post
    Hi Dave,
    It works but copies everything from line 1 to 5 and not everything line 5 onwards.

    I have put in a 'MsgBox f' after the f = ws.Range......line to see what value of 'f' is being carried forward and it just says 1.

    Any ideas?

    Thanks
    yes, you must have nothing in columnA
    This will find the last row in the worksheet
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    01-18-2009
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Pasting data onto Sheet

    Job Done.
    Fantastic. Thanks for your help

+ 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