+ Reply to Thread
Results 1 to 7 of 7

Loop through row and copy corresponding column

  1. #1
    Registered User
    Join Date
    04-04-2016
    Location
    Blackpool
    MS-Off Ver
    2013
    Posts
    6

    Red face Loop through row and copy corresponding column

    i want to loop through the A row but i want to skip the cell if there is no value, but when there is a value i want to copy
    the values in the corresponding column and save them to another worksheet to the range stated in the active cells value.

    this is kind of what I want to do:


    Dim lCol As Long

    For lCol = 1 To 100

    if active cell is empty
    do nothing

    else

    select range of active cell and copy contents of column of cell and paste in sheet 2 in the range of active cells value.

    next 1coll.


    I know what I want to do, I just cant work out how ):
    any help with be grateful

  2. #2
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Loop through row and copy corresponding column

    Hi there!
    Do you think that you can upload a dummy workbook and explain in it? maybe a before and after sheet?
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

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

    Re: Loop through row and copy corresponding column

    This makes the following assumptions 1) Column A is your copy criteria, 2) you want too copy the entirerow.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-04-2016
    Location
    Blackpool
    MS-Off Ver
    2013
    Posts
    6

    Re: Loop through row and copy corresponding column

    bulina2k
    Ok I think ive uploaded an attachment with a dummy file
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-04-2016
    Location
    Blackpool
    MS-Off Ver
    2013
    Posts
    6

    Re: Loop through row and copy corresponding column

    Hey, ive attached a dummy excel file

  6. #6
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Loop through row and copy corresponding column

    Hi HushHoney,
    maybe so
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-04-2016
    Location
    Blackpool
    MS-Off Ver
    2013
    Posts
    6

    Re: Loop through row and copy corresponding column

    Hi Guys I figured it out.. here is my code

    Please Login or Register  to view this content.

+ 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. loop through range to copy row if data exists in column, then delete the column
    By wpryan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2015, 05:03 PM
  2. copy loop array to a column
    By raufbold in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-23-2015, 03:43 PM
  3. Loop copy paste to next column
    By miles.boyle in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 08-30-2013, 05:32 AM
  4. [SOLVED] Copy dynamically changing column and Paste using VBA Loop (Loop within Loop)
    By nixon72 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-12-2013, 12:46 PM
  5. [SOLVED] Loop-copy cell values from a row, and then copy them into a column
    By vukovicnikola in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-15-2012, 06:03 AM
  6. Replies: 1
    Last Post: 05-06-2011, 03:08 AM
  7. Copy in a loop down column
    By rhudgins in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-21-2010, 05:57 PM

Tags for this Thread

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