+ Reply to Thread
Results 1 to 14 of 14

Urgent need for VBA script - Copy sheet with macros and paste as values

  1. #1
    Registered User
    Join Date
    08-26-2017
    Location
    Oslo
    MS-Off Ver
    Office 2016
    Posts
    7

    Urgent need for VBA script - Copy sheet with macros and paste as values

    Not so experienced in VBA and need help on VBA macro on a calculation sheet that i have made.
    I want to make a button to copy the sheet and paste it into a new sheet, removing formulas and paste everything as values.



    When trying script i found online i can't make them to to work so im a little bit frustrated :-)

    Thanks in advance

    Espenlor

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Urgent need for VBA script - Copy sheet with macros and paste as values

    Use your Macro Recorder.

    Select the developer tab
    Select record macro

    Record yourself copying and pasting your data

    Select the developer tab
    Select Stop recording.

    Now you are in a position to be able to paste a rough macro onto this forum for us to look at.

    Please remember to use Code Tags.




    RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found [URL="http://www.excelforum.com/misc.php?do=bbcode"]here[/URL
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    08-26-2017
    Location
    Oslo
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Urgent need for VBA script - Copy sheet with macros and paste as values

    This is the code i manage to get with record.

    But it doesn't work

    Please Login or Register  to view this content.
    Last edited by Espenlor; 08-26-2017 at 10:51 AM.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Urgent need for VBA script - Copy sheet with macros and paste as values

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Urgent need for VBA script - Copy sheet with macros and paste as values

    Your code can be reduced to:-

    Please Login or Register  to view this content.

    What did you intend it to do?
    Last edited by mehmetcik; 08-26-2017 at 11:10 AM.

  6. #6
    Registered User
    Join Date
    08-26-2017
    Location
    Oslo
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Urgent need for VBA script - Copy sheet with macros and paste as values

    Thanks for quick answer.

    Tried this but get errors on first command here

    Please Login or Register  to view this content.

    attache the pictures on the error here.Errors-VBA-Copy.PNG

  7. #7
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Urgent need for VBA script - Copy sheet with macros and paste as values

    Make sure of the sheet name .. May be there is extra space at the end of the sheet !!
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  8. #8
    Registered User
    Join Date
    08-26-2017
    Location
    Oslo
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Urgent need for VBA script - Copy sheet with macros and paste as values

    Hello again.

    The sheetname are correct, with no spaces.

    As you can see this is the error message

    Errors-VBA-Copy-1.PNG

  9. #9
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Urgent need for VBA script - Copy sheet with macros and paste as values

    Where are you running the Macro from?

    Does the active workbook have a sheet named "Bestillingark"

  10. #10
    Registered User
    Join Date
    08-26-2017
    Location
    Oslo
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Urgent need for VBA script - Copy sheet with macros and paste as values

    Running the macro in the same workbook, called Bestillingark.xlsb

    I upload the sheet here.
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Urgent need for VBA script - Copy sheet with macros and paste as values

    Hi

    There is nothing wrong with the Macro

    Your Sheet is corrupted.

    I copied the sheet to a new workbook and it now works.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    08-26-2017
    Location
    Oslo
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Urgent need for VBA script - Copy sheet with macros and paste as values

    I downloaded and tried, i see the code are running but the new duplicated sheet in a new workbook is not showing.

  13. #13
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Urgent need for VBA script - Copy sheet with macros and paste as values

    It works here

    Try restarting your pc before opening this workbook.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    08-26-2017
    Location
    Oslo
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Urgent need for VBA script - Copy sheet with macros and paste as values

    Hello again, and thanks for good help.
    I had to use the file you sent and rebuild my formulas on that.
    How to you clean documents when they are corrupted as mine where ?

    I have another question to.
    In this sheet i have 2 hidden sheets, one with the hole stock of products and another with vlookup on postnumber sheet.

    When i run your macro, is is quick to delete those to hidden sheets ??

    Br
    Espenlor

+ 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] Macros to copy from one sheet and paste in another
    By Mamoks in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-06-2014, 10:54 AM
  2. VB Script to copy particular cell values and paste in new sheet?
    By WL2005HBD in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-20-2013, 10:39 PM
  3. VBA script problem - Copy and Paste Special data from one sheet to another.
    By akarev in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-05-2013, 12:19 PM
  4. Copy - Paste Special.Values (with extra function) VBA Script needed!
    By Kevin2110 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-19-2011, 10:07 AM
  5. More efficient script for insert new worksheets, copy and paste values?
    By SDBoca in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2011, 11:07 AM
  6. Copy / Paste Special Values Script
    By TomTom_BV in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-26-2009, 09:05 AM
  7. Replies: 1
    Last Post: 01-04-2005, 06:06 PM

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