+ Reply to Thread
Results 1 to 10 of 10

Need help vb marco copy a range of data to a template

  1. #1
    Forum Contributor
    Join Date
    03-28-2013
    Location
    *
    MS-Off Ver
    Excel 2010
    Posts
    226

    Need help vb marco copy a range of data to a template

    Hello Every Body,

    I am new to this forum and from last 10 days I am reading posts in this forum, there is lot to learn in this forum. Thank you everybody who are contributed here.

    Thank you for each and every Excel Super Stars here.


    I am new for VB Excel Marcos; I am in basic stage of Excel VB Marcos.

    I need help from you guys. I already created a Marco for my problem. But it’s too big. Anybody here can help how can I do it in short way.

    I have bunch File Names In Sheet2 column A

    When I Clikc button Copy paste its need to copy paste the data from Sheet2 column A to Sheet1 Template.


    I just want is there any other ways doing this……

    Here is my code:


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by venkatpvc; 04-09-2013 at 10:13 AM.

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

    Re: Need VB Marco Help...

    Hi

    Why are you creating all those ranges?

    is this to copy the data across or do you actually need them ?

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    03-28-2013
    Location
    *
    MS-Off Ver
    Excel 2010
    Posts
    226

    Re: Need VB Marco Help...

    Like I said before, I am new to VB Marcos

    I am learning that's why I posted this question is there any better way to do this?

    Thank you,

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

    Re: Need VB Marco Help...

    replace your copy paste lines with the following:-

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    03-28-2013
    Location
    *
    MS-Off Ver
    Excel 2010
    Posts
    226

    Re: Need VB Marco Help...

    Thank You, mehmetcik.

    You Showed me easy way I will change my entire Code. Any more suggestions on this. or I can close my thread with solved.

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

    Re: Need VB Marco Help...

    Yes.

    If your pages were side by side then a simple loop three or four lines would replace all your copy paste routines.

    I will create one for you. Just to demonstrate.

    If you insist on the sheets being arrange vertically then you will need two nested loops. bit more complicated.

  7. #7
    Forum Contributor
    Join Date
    03-28-2013
    Location
    *
    MS-Off Ver
    Excel 2010
    Posts
    226

    Re: Need VB Marco Help...

    Can you give me a demonstrate sir? Thats really help for my learning process.

    Thank you,

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

    Re: Need VB Marco Help...

    This replaces call your copy paste code.

    Please Login or Register  to view this content.
    Attached Files Attached Files

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

    Re: Need VB Marco Help...

    Additionally

    You do not need to modify it as your data grows.

    However you will need to format the pages.

    But that is another issue.

    Copy Paste special Formats for a whole page in a loop like the one above is all you need.

    but remember to make all the columns the same width.

  10. #10
    Forum Contributor
    Join Date
    03-28-2013
    Location
    *
    MS-Off Ver
    Excel 2010
    Posts
    226

    Re: Need VB Marco Help...

    Thank You so much for you help!!!

+ 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