+ Reply to Thread
Results 1 to 7 of 7

Copying range of cells to a bookmark in word

  1. #1
    Forum Contributor
    Join Date
    02-08-2006
    Location
    UK
    MS-Off Ver
    2013
    Posts
    204

    Copying range of cells to a bookmark in word

    I'm using the following code to paste information from excel to word:

    Please Login or Register  to view this content.
    It works absolutely fine. however I have a range of cells (B2:H40 which is essentially a table) which I have tried pasting in the same fashion (...range.text = ....range(B2:H40)) with no luck - I get a run type error 13 - Type Mismatch.

    The bookmark in questions is at the beginning of the second page of Word, so I have tried using wdgotopage function but I don't know how to use it.

    Anyone have any ideas on how to solve this?
    Last edited by royUK; 11-11-2010 at 05:16 AM.

  2. #2
    Registered User
    Join Date
    11-10-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Copying range of cells to a bookmark in word

    I might be barking up the wrong tree but have you got quotes around the range? ie Range("B2:H40")

  3. #3
    Registered User
    Join Date
    11-10-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Copying range of cells to a bookmark in word

    Apologies Just realised that was code:

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    02-08-2006
    Location
    UK
    MS-Off Ver
    2013
    Posts
    204

    Re: Copying range of cells to a bookmark in word

    Sorry - my message is a bit messy. The brackets and quotes are there!

    It doesn't seem to like having a range of cells being put to a bookmark (which does work as when I try and use just one cell, it works fine).

  5. #5
    Forum Contributor
    Join Date
    02-08-2006
    Location
    UK
    MS-Off Ver
    2013
    Posts
    204

    Re: Copying range of cells to a bookmark in word

    I've tried recording a macro but that doesn't work

    Anyone have other ideas or code?

  6. #6
    Forum Contributor
    Join Date
    02-08-2006
    Location
    UK
    MS-Off Ver
    2013
    Posts
    204

    Re: Copying range of cells to a bookmark in word

    I've found on another forum that a range can be set as Dim [rangename] word.range.

    Problem is I can't figure out how to use it. I've got this so far:
    Please Login or Register  to view this content.
    Now how do I get the cells B1: I40 to paste? (wdDoc is already set).

    Thanks.
    Last edited by wonderdunder; 11-11-2010 at 07:44 AM.

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Copying range of cells to a bookmark in word

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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