+ Reply to Thread
Results 1 to 3 of 3

Do While/ If Then Loop to copy

  1. #1
    Registered User
    Join Date
    10-02-2009
    Location
    Switzerland
    MS-Off Ver
    Excel 2003
    Posts
    2

    Cool Do While/ If Then Loop to copy

    Hi everyone,

    i'm a true blue beginner with VB in excel, just started this week. basically i was always doing this list manually and it involves alot copying and pasting from a certain list on say sheet 1 to a structured list on sheet 2. i tried at first to do it with a "Do while loop" while trying to nest an "IF/then" but i couldn't get it to work..so i did a rather tedious work around with "Do until loop". so now i basically wrote a code to simulate the manual work but i feel that it can be refined with more sophisticated programming. obviously i cannot figure out how to do this on my own so i thought i would ask for some help here.. i've uploaded the file (see link below) with the code that is fully working at the moment, but very bulky and could definitely use improvement!

    http://www.4shared.com/file/13693508...c/97-2003.html

    the main gist of the exercise is to copy blocks of information with a certain commonality into another sheet, together with the appropriate heading. i would like to have only 2 blocks of this info per column, followed by an empty "separator" column, and then a next column where the subsequent info starts to be pasted into again.

    i've only done 3 or 4 headings+info blocks in my example. in total there are about 9 or 10 headings and info blocks. So if i were to extrapolate the current macro for the next 6 or 7 parts, it would be really long. so im thinking maybe there's a way to shorten or refine it..i really dont know how..with an array or something? but i really have no idea about it so i dont know where to begin.

    any help would be very very much appreciated!

    thank you!

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    re: Do While/ If Then Loop to copy

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    I'll edit this time but make sure that you read the rules before posting again.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    10-02-2009
    Location
    Switzerland
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Do While/ If Then Loop to copy

    Hi Roy,

    Thanks for the heads up. I wasn't aware that the thread title was not concise enough. Apologies for that. And thank you for changing the title for me.

    If anyone out there can please help me to refine the code, I would really grateful. Thank you.

+ 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