+ Reply to Thread
Results 1 to 11 of 11

Paste Value Macro Yielding Blank Cells

  1. #1
    Registered User
    Join Date
    10-27-2014
    Location
    Houston, TX
    MS-Off Ver
    MS Office 2010
    Posts
    5

    Paste Value Macro Yielding Blank Cells

    Hello,

    So I have been working on a paste value macro and when I run it, every cell has the correctly pasted values except for one row. I have since isolated it to just writing a paste value macro for just that one row and it still comes up blank. Here is what I have written (It copies from one sheet to another in the same workbook):
    Please Login or Register  to view this content.
    Any ideas? Thanks.
    Last edited by Leith Ross; 10-27-2014 at 07:51 PM. Reason: Added Code Tags

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,455

    Re: Paste Value Macro Yielding Blank Cells

    The code looks ok, if not the most efficient.

    Maybe you'd care to upload a sample workbook

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Paste Value Macro Yielding Blank Cells

    Hello bdr2831,

    Welcome to the Forum!

    The PasteSpecial method does not check for blank cells, rows, or columns before pasting. You would have to do this check your self before pasting to the destination.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    10-27-2014
    Location
    Houston, TX
    MS-Off Ver
    MS Office 2010
    Posts
    5

    Re: Paste Value Macro Yielding Blank Cells

    @Leith Ross, the cells are blank before I paste into them - it is just that when I run the macro, the cells remain blank that is giving me issues.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Paste Value Macro Yielding Blank Cells

    Hello bdr2831,

    Try this...
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-27-2014
    Location
    Houston, TX
    MS-Off Ver
    MS Office 2010
    Posts
    5

    Re: Paste Value Macro Yielding Blank Cells

    hmm that's just giving me a syntax error.

    also @TMS, it does work when I move it to another sheet, I however, cannot upload the document I am working on that's having this problem.

    Thanks for your replies.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,455

    Re: Paste Value Macro Yielding Blank Cells

    Do you have any hidden columns?

  8. #8
    Registered User
    Join Date
    10-27-2014
    Location
    Houston, TX
    MS-Off Ver
    MS Office 2010
    Posts
    5

    Re: Paste Value Macro Yielding Blank Cells

    I just noticed that there are hidden columns...does this have an effect?

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,455

    Re: Paste Value Macro Yielding Blank Cells

    Well, the copied cells will go into the columns regardless of whether or not they are hidden. So the data may have been copied, just not visible.

  10. #10
    Registered User
    Join Date
    10-27-2014
    Location
    Houston, TX
    MS-Off Ver
    MS Office 2010
    Posts
    5

    Re: Paste Value Macro Yielding Blank Cells

    Well, I did check those columns in case that was happening, then re-hid the columns and tried it again and it worked...

    Thanks for your help!

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,455

    Re: Paste Value Macro Yielding Blank Cells

    You're welcome.




    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. Yielding to others while macro is running?
    By vientito in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-20-2013, 02:14 PM
  2. [SOLVED] copy/paste macro to selected blank cells
    By fumc in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-04-2012, 10:08 PM
  3. Ignore, or display blank for cell yielding #DIV/0!
    By jgray in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-03-2010, 11:24 AM
  4. [SOLVED] Copy and paste macro-blank cells thereafter.
    By Bikernick in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-04-2006, 12:00 PM
  5. Using a Macro to paste into Blank Cells
    By phillipsb in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-05-2005, 01:05 PM

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