+ Reply to Thread
Results 1 to 5 of 5

Copy Value from selected cells to a new workbook sheet

  1. #1
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Copy Value from selected cells to a new workbook sheet

    Dear all,

    I hope you are all well.

    I am having a issue copying contents from a selection of cells (Workbook "A") to another Workbook "B".

    Both worksheets from both files are identical with the difference that the original (A) has Data Validation; Conditional Formatting and formulas, but the file "B", it's only static data from file "A".

    I have managed to copy the contents of file "A" to file "B" but I can't manage to paste values only. It copies all formatting from file "A" and I just want the values.

    The other thing is, after running the Macro to copy data from file "A" to "B", the file "B" looses some formulas that I have outside the range that is been paste.
    E.g. I want to copy the contents of file "A" from cells F1:Z1 as paste them to the same range in file "B". If I have a formula on file "B" in cell A1, after running the macro, this cell looses the formula and shows only the value.

    Here's the code I am using:

    Please Login or Register  to view this content.
    Is there something wrong on the code or something missing?

    As mentioned, the file "A" = "Administration 2013.xlsm"
    File "B" (where data is been transported/copied) = "Workload Tool 2013.xlsx"

    Your assistance on this will be highly appreciated.

    Many thanks in advance and kind regards,
    Filipe Oliveira

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Copy Value from selected cells to a new workbook sheet

    Hi, Filipe Oliveira ,

    PasteSpecial xlPasteValues turns everything in the Selection to constants.

    Maybe try the following code:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Re: Copy Value from selected cells to a new workbook sheet

    Hi Holger,

    Thanks a million for your reply.

    This formula worked as I want it to. That's brilliant and much easier and less code for what I have because I need to do the same for 3 different worksheets.

    I am really appreciated with your help here

    Best regards,
    Filipe Oliveira.

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Copy Value from selected cells to a new workbook sheet

    Hi, Filipe Oliveira,

    I hope you have corrected the wrongs in the code to read it like
    Please Login or Register  to view this content.
    Ciao,
    Holger

  5. #5
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Re: Copy Value from selected cells to a new workbook sheet

    Hehehe

    Yes, I did. I didn't wanted to tell you as it could sound bad. You helped me a lot already.

    Thanks a million,
    Filipe Oliveira

+ 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