+ Reply to Thread
Results 1 to 2 of 2

macro that copies information from a worksheet from workbook A then opens a new workbook a

  1. #1
    Forum Contributor
    Join Date
    05-30-2013
    Location
    Isreal
    MS-Off Ver
    Excel 2010
    Posts
    191

    macro that copies information from a worksheet from workbook A then opens a new workbook a

    Hello.
    I am new to VBA.
    I am trying to make a macro that copies information from a worksheet from workbook A then opens a new workbook and copies the information as value only(no formulas)
    Unfortunately I get stuck in the stage of pasting the values.
    Attached is the relevant code of the macro.
    Please note: the macro gets stuck in the following line “Worksheets(1).Range("a1").PasteSpecial xlPasteValues”
    [/I]
    Here is the code:
    wkb.Activate
    Sheets("swimmer").Select
    ActiveSheet.Copy
    Set wkb_new = Workbooks.Add
    wkb_new.Worksheets(1).Activate
    wkb_new.Worksheets(1).Select
    Worksheets(1).Range("a1").PasteSpecial xlPasteValues



    Your help is appreciated.
    Have a nice day

  2. #2
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: macro that copies information from a worksheet from workbook A then opens a new workbo

    Hi starlev and welcome to the forums where an amazing bunch of volunteers generously give of their spare time to help others, yes even though it may not be immediately obvious, most of us do have "real jobs"

    SO, firstly, please take the time to read the forum rules, they are not onerous and are designed to make helping you easier for everybody who sees your problem post.

    Secondly, if AT ALL possible please attach a sample spreadsheet with your inputs and expected results AND the code you have tried so far. As I mentioned, we are all volunteers and the task of having to dream up a spreadsheet that may or may not look like yours is often enough to make us say "this post is too hard" and just bypass your question altogether

    Thirdly, please (as the rules ask) use the code tags (click on the "#" icon on the toolbar for the posts). It keeps the formatting and makes it easy for us to see what you are doing in the code

    I am guessing that your problem resolution is actually very simple

    jmac1947

+ 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. Macro which opens workbook, runs macro, copies and then closes
    By Vihral in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-06-2013, 11:45 AM
  2. Macro that opens another workbook and copies a worksheet onto existing one.
    By evisu18 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-11-2012, 09:15 PM
  3. Macro that copies information from one workbook into a rollbook
    By RobMarshall in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2008, 11:47 PM
  4. Workbook opens multiple copies
    By mba1 in forum Excel General
    Replies: 3
    Last Post: 04-03-2007, 03:10 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