+ Reply to Thread
Results 1 to 3 of 3

Auto-increment cell selection

  1. #1
    Registered User
    Join Date
    10-18-2012
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003/2007
    Posts
    7

    Auto-increment cell selection

    Ok, so I have a ream of measurement results (over 500), which need to be sorted into a results table. This table is a collection groups of fifteen results (three columns of 5), 36 in total. So the current method is to go through by hand copy and pasting each group of 5 into the right part over and over 36*3 times - VERY time consuming, clearly. I am tryign to make a macro to speed this up, and am wondering if I can get VBA to automatically increment the values?

    Example:
    Please Login or Register  to view this content.
    That is the first one, the next should be:
    Please Login or Register  to view this content.
    After one more shift sideways, it then goes DOWN to:
    Please Login or Register  to view this content.

    Clearly I can just go through doing it myself, but I have a LOT of macros doing similar jobs to make (I am working on replacing two guys about to retire in this department and don't want to waste my time on the amount of manual work with excel they do!), and I would find an automatic solution SO much easier.

    I have thought of one possible solution (if there isn't an in-built command), but don't have the knowledge of VBA to implement it - use 'Range("Ax:Ay").Select' where 'x' and 'y' are subjected to an increment somehow. No idea if that's possible for various reasons.!

    Any tips would be great - apologies if this has been covered before, but I couldn't find it...

    Cheers, Rohan

  2. #2
    Registered User
    Join Date
    10-18-2012
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003/2007
    Posts
    7

    Re: Auto-increment cell selection

    Ok, so after some fiddling, I have got it to very nearly work with my idea for a work around. However, now I get an error saying the copy/paste areas are not the same size, which means I am clearly missing something as regards the use of 's=s+5' Any one got any ideas? :/

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-18-2012
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003/2007
    Posts
    7

    Re: Auto-increment cell selection

    Ok, so I've seen my error, "Range("As:At").Select" is wrong. That's sorted.

    Now my problem is looking for an easy way to just repeat those steps enough times to fill the sheet. The s=s+5 bit works, but I currently have to paste it in after every use of the subroutine - I tried including it into the subroutine, but I guess variables aren't carrired between then. Is it possible to use some form of 'goto' command here, instead of the seperate subroutine I currently have?

    *gets ***** and dances like no-ones watching, cause, well, clearly no-one is :P

    Cheers, Rohan

+ 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