+ Reply to Thread
Results 1 to 4 of 4

Excel to Word macro fails when started from another sheet

  1. #1
    Forum Contributor
    Join Date
    03-18-2013
    Location
    Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    139

    Excel to Word macro fails when started from another sheet

    Hey guys!

    I have this macro that exports a table from Excel to Word. It works fine if I run it from the proper worksheet. However if I run it from another worksheet, it copies from row 28, instead of row 173. It is supposed to export the table from row 173 till the last used row. What is wrong with the macro?

    Please Login or Register  to view this content.
    Thank you in advance!

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Excel to Word macro fails when started from another sheet

    It's because you define the Lastrow based on the activesheet. Try (untested):
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    03-18-2013
    Location
    Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Excel to Word macro fails when started from another sheet

    Works perfect, thanks!!

  4. #4
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Excel to Word macro fails when started from another sheet

    You're welcome, glad it worked!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro Chart.Axes fails in Protected sheet
    By shammi_Raj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-29-2013, 01:27 AM
  2. Pasting text from excel to word fails
    By Alexander_Golinsky in forum Excel General
    Replies: 0
    Last Post: 08-21-2012, 05:22 AM
  3. [SOLVED] Pasting as plain text from excel to word fails
    By Alexander_Golinsky in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2012, 01:06 PM
  4. Chart Macro Fails When Sheet Is Protected
    By Philb1 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 09-16-2011, 06:03 AM
  5. Focus back to the Excel Sheet I started on after the Database Updates on a sheet.
    By ca1358 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-21-2011, 11:44 AM

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