+ Reply to Thread
Results 1 to 3 of 3

How can I put this code into a loop..

  1. #1
    Registered User
    Join Date
    06-08-2015
    Location
    Bristol
    MS-Off Ver
    2013
    Posts
    75

    How can I put this code into a loop..

    Hiya,

    I've designed a spreadsheet withabout 15 editable fields. It has a 'save' button which runs a macro that moves everything that's been edited into another sheet.. One row per customer..

    Please Login or Register  to view this content.
    My question is, is there a better way of doing it... I'm thinking a loop but the cell reference is different on each line..


    Cheers,
    Last edited by purpleozzie; 01-29-2021 at 12:01 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: How can I put this code into a loop..

    Your right that a loop is not possible as the addresses of the righthand side are not in a logical sequence.
    But you can loop using the For Each loop.

    Please Login or Register  to view this content.
    Can you please edit your post to fix the code tags.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    06-08-2015
    Location
    Bristol
    MS-Off Ver
    2013
    Posts
    75

    Re: How can I put this code into a loop..

    Thanks Andy.. Worked perfectly

+ 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. VBA code to copy and loop (within a loop)
    By smarteloops in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-01-2017, 08:03 AM
  2. [SOLVED] How can I make this code shorter by using a loop. or there's any easier shorcuts code
    By romarkevinruiz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-10-2014, 08:53 AM
  3. [SOLVED] How to put the code in a for loop or simplifing the code
    By willy292 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-09-2013, 06:34 AM
  4. VBA Loop Code Help
    By Gary_A_S in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-10-2013, 02:36 PM
  5. Code to turn this code into a loop doing muliple copies
    By fbplaya02 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-30-2013, 12:02 PM
  6. Excel 2007 : VBA Loop Code --- Help me :-)
    By EggHead in forum Excel General
    Replies: 2
    Last Post: 12-14-2009, 03:20 PM
  7. How To Loop with below code
    By pr4t3ek in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-10-2008, 09:39 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