+ Reply to Thread
Results 1 to 10 of 10

VBA or MACRO to copy table into another worksheet

  1. #1
    Registered User
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    19

    VBA or MACRO to copy table into another worksheet

    I had this orginally posted in formula category, but maybe Excel Programing /VBA / Macro is much more appropriate.

    This might be harder to explain...but I'll try my best.


    I need help copying data from one table (tab "Raw Data) to another (Tab "Sheet 1). The tricky part is that sometimes the data isnt the same in regards to column and rows. I tried to color code what needs to go where. Please let me know if there is i need to elaborate some more.
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,833

    Re: VBA or MACRO to copy table into another worksheet

    Try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    19

    Re: VBA or MACRO to copy table into another worksheet

    Okay...I tried to be slick about it and only show portion of my Workbook. My plan was to take the codes and change the values in the code to make it work in the orginal workbook and it didnt work. So what did I do wrong?


    Here is what I chnaged in the code from what you provided, but didnt work. As you can see the tab name for the "Copy Sheet" changed from "Sheet1" to "Industry View" and where I wanted it to paste changed from "A1" to "B82" etc...

    Sub CopyCols()
    Application.ScreenUpdating = False
    Sheets("Raw Data").Columns("A").Copy Sheets("Industry View").Range("B82")
    Sheets("Raw Data").Columns("B:D").Copy Sheets("Industry View").Range("I82")
    Sheets("Raw Data").Columns("E:U").Copy Sheets("Industry View").Range("L82")
    Application.ScreenUpdating = True
    End Sub

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA or MACRO to copy table into another worksheet

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    19

    Re: VBA or MACRO to copy table into another worksheet

    Quote Originally Posted by JOHN H. DAVIS View Post
    Maybe:

    Please Login or Register  to view this content.
    Didnt work...Mumps1 code worked...but im trying to change the value to work for the orginal workbook.

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA or MACRO to copy table into another worksheet

    Worked for me when I tested it on your sample?

  7. #7
    Registered User
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    19

    Re: VBA or MACRO to copy table into another worksheet

    A few columns worked, but then I recieved an error that VBA is out of memory

  8. #8
    Registered User
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    19

    Re: VBA or MACRO to copy table into another worksheet

    Sub CopyCols()
    Application.ScreenUpdating = False
    Sheets("Raw Data").Columns("A").Copy Sheets("Industry View").Range("B82") Looks like the problem is changing the row.Becasue B1 would work, but changing it to B2 or any number(row) from 1 would give me an error.
    Sheets("Raw Data").Columns("B:D").Copy Sheets("Industry View").Range("I82")
    Sheets("Raw Data").Columns("E:U").Copy Sheets("Industry View").Range("L82")
    Application.ScreenUpdating = True
    End Sub

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA or MACRO to copy table into another worksheet

    Quote Originally Posted by bunl View Post
    A few columns worked, but then I recieved an error that VBA is out of memory
    FWIW:

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    19

    Re: VBA or MACRO to copy table into another worksheet

    Quote Originally Posted by JOHN H. DAVIS View Post
    FWIW:

    Please Login or Register  to view this content.
    That worked....but it does need to be tweak a tad bit. As the year goes on, there will be months added/deleted as well as rows expanding or shrinking. Is there a way to it search for last entry? I also need it to starting the past in B81

+ 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 to copy/paste same table continually in same worksheet
    By Katze12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-30-2013, 03:49 PM
  2. Copy paste table into new worksheet macro
    By Mr ZN in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-31-2013, 02:41 AM
  3. [SOLVED] Macro/VBA code to Copy data from primary worksheet to a worksheet opened by macro
    By MHamid in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-30-2013, 11:10 AM
  4. Replies: 1
    Last Post: 04-27-2012, 10:42 AM
  5. macro to filter data table and copy it to another worksheet
    By jarssonn in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 04-07-2010, 01:28 AM

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