+ Reply to Thread
Results 1 to 5 of 5

looping through a column

  1. #1
    Registered User
    Join Date
    11-25-2014
    Location
    England
    MS-Off Ver
    2013
    Posts
    2

    looping through a column

    Hi, I wonder if anyone could help me?

    I am trying to loop through column P, rows 1 to 10

    each time I press the button, I would like to copy & paste the value into cell D5

    ie: first press will copy and paste cell P1 into cell D5, second press P2 into D5, third press P3 into D5 etc.

    Thanks in advance

    Craig

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: looping through a column

    What about pressing the button more than 10 times?


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,487

    Re: looping through a column

    Why not enter in D5=P10 as that will be your end result.

    What are you trying to accomplish?
    Last edited by davesexcel; 12-03-2014 at 06:45 AM.

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,516

    Re: looping through a column

    Hi there,

    Take a look at the attached workbook and see if it does what you want.

    Cells A1 and A2 can be moved to a more suitable location on your worksheet if appropriate - just change the highlighted value to that of the new location of Cell A1, i.e. the cell which contains the row number of the cell to be copied. The second cell contains the text which is displayed on the button which causes the Copy operation to take place.

    Please Login or Register  to view this content.
    Hope this helps - please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files
    Last edited by Greg M; 12-03-2014 at 07:29 AM. Reason: Modified workbook uploaded

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

    Re: looping through a column

    This uses a helper cell in this case A1. You first put a 1 in A1.

    Please Login or Register  to view this content.
    Hope that helps.

+ 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. [SOLVED] Looping through rows in a column and the moving onto the next column
    By MoonWeazel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-31-2012, 03:52 AM
  2. Looping through a column
    By Ricardo9211 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-28-2009, 06:20 PM
  3. looping through a column
    By georgemathews in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-10-2009, 02:18 PM
  4. Row and Column looping Macro help
    By NickSS in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-28-2008, 10:22 AM
  5. Looping through a column
    By hudson40 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-16-2005, 11:05 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