+ Reply to Thread
Results 1 to 8 of 8

How to copy values

  1. #1
    Registered User
    Join Date
    10-03-2012
    Location
    oslo
    MS-Off Ver
    Excel 2010
    Posts
    16

    How to copy values

    Hi,

    I have 42 workbooks i want to copy values from a databank sheet. I,ve written a code that works through each workbook to copy the needed cells into a master workbook. The problem is that it copies references instead of values. The reference is to filepath+workbookname+cellreference. I want only the values. I,ve tried the paste special coding but it fails. Can anybody see where my mistake is?

    Please Login or Register  to view this content.

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

    Re: How to copy values

    Kandre,
    I do not see any copy line in your code, except this line

    Please Login or Register  to view this content.
    Where are you pasting the copied values in to?

  3. #3
    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,197

    Re: How to copy values

    Hi, kandre,

    AFAIK you need not unhide the sheet to copy the data. Give this a try:

    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

  4. #4
    Registered User
    Join Date
    10-03-2012
    Location
    oslo
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: How to copy values

    Hi guys and thank you for the posts. Need to clarify what I'm after. This macro copies and pastes from all the workbooks into a mastersheet. The problem is that it doesn't copy values. It copies the formulas that's in each of the cells of each wb.

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

    Re: How to copy values

    But in which part of your code shows you are copying from area A to and pasting it to area B, assuming you posted the full code?

  6. #6
    Registered User
    Join Date
    10-03-2012
    Location
    oslo
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: How to copy values

    I have commented in the code.

    With range - copies
    .copy wsmaster - pastes

  7. #7
    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,197

    Re: How to copy values

    Hi, kandre,

    the sniplet I supplied doesn´t use Copy&Paste but should copy the values from one sheet to the other - any run time errors ocurring or values not being copied with that (code did good in quick samples to check)?

    Ciao,
    Holger

  8. #8
    Registered User
    Join Date
    10-03-2012
    Location
    oslo
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: How to copy values

    Worked perfectly. Thanks

+ 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