+ Reply to Thread
Results 1 to 4 of 4

VBA copy paste (normal) working, VBA Pastespecial (not working)

  1. #1
    Registered User
    Join Date
    01-05-2022
    Location
    Amsterdam South
    MS-Off Ver
    2010 MAC
    Posts
    14

    Question VBA copy paste (normal) working, VBA Pastespecial (not working)

    Hi all!

    My name is Dennis, I am new to this forum. I am a novice when it comes to programming with Excel, I am learning about intermediate formula's since a few months. I'm building my personal invoice system and bit by bit its getting more advanced and useful =)

    There is one thing I am not figuring out, even with studying all 203 posts concerning the Pastespecial ability. I try to link a VBA code to a button. If that button is pressed, it should automatically paste the values of some specific cells (from the sheet Invoice) to a logbook, being another sheet. It should also recognize in which sheet (logbook) the data should be pasted based on the date value of a cell (the month of the date).

    This all is more advanced, but the first step is to understand how I copy paste the data in the first place.

    When I use the following VBA code I can copy paste the data successfully.

    Please Login or Register  to view this content.
    However, when I try the following code it does nothing:

    Please Login or Register  to view this content.
    Im sure its something small, but what issue am I not seeing?
    Last edited by Dann1s; 01-14-2022 at 09:21 AM. Reason: Change prefix

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA copy paste (normal) working, VBA Pastespecial (not working)

    On Error Resume Next next Error is hiding your errors

    You need to put in the copy and paste values on separate lines

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-05-2022
    Location
    Amsterdam South
    MS-Off Ver
    2010 MAC
    Posts
    14

    Talking Re: VBA copy paste (normal) working, VBA Pastespecial (not working)

    my bad, I should have known After following the error it seemed a minor issue;
    My excel expects me to use the format .Pastespecial .xlPasteValues instead of .Pastespecial (xlPasteValues), how odd.

    Thanks for he help AB!

    EDIT
    I also managed to automatically select in which of the 12 sheets (monthlog) the values are pasted, though I am sure there would be a much shorter and efficient code for it, for example using the function Transpose . Now the cell H8 " from the sheet Backoffice gives the current month in number (1 t/m 12). If I finished the entire project I will try to shorten the code I'm using now below:

    Please Login or Register  to view this content.
    Last edited by Dann1s; 01-06-2022 at 12:18 PM. Reason: Additional information copying same values to different sheets based on current month

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA copy paste (normal) working, VBA Pastespecial (not working)

    Not Much!
    You can group cells into a range or use a union function, but paste can only work on consecutive range. In other words, you can't jump from Column C to E if you also want use paste formats.

+ 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. [SOLVED] Range.PasteSpecial not working
    By jkj115 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-02-2016, 04:05 PM
  2. PasteSpecial not working VBA Excel for Mac
    By OliverBrain in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-01-2015, 06:55 AM
  3. Copy + paste not working as "normal"
    By truohol in forum Excel General
    Replies: 5
    Last Post: 11-26-2013, 08:26 AM
  4. Replies: 2
    Last Post: 08-17-2012, 08:16 AM
  5. Copy/PasteSpecial Not Working
    By Versaiteis in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-07-2009, 04:14 PM
  6. PasteSpecial not working perfectly
    By ctmurray in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-12-2008, 04:20 PM
  7. [SOLVED] Copy PasteSpecial not working
    By Richard Buttrey in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-11-2006, 11:45 AM

Tags for this Thread

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