+ Reply to Thread
Results 1 to 4 of 4

Paste in to specifed columns (10 to the right) on next iteration of loop

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-11-2017
    Location
    Edinburgh, Scotland
    MS-Off Ver
    2010
    Posts
    110

    Paste in to specifed columns (10 to the right) on next iteration of loop

    Hi

    I have a 'for i = 1 to 3' loop running through the first 3 sheets where I am applying a filter for non blanks in column H then copying all non blank rows of columns B:H.

    I am trying to paste the data from Sheet1 in to cell A4 of sheet 4 then paste the data from Sheet2 in to K4 (i.e. 10 columns to the right of column A) of sheet4 then paste the data from sheet 3 in to U4 (i.e. 10 columns the right of column K).

    Thanks in advance

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: Paste in to specifed columns (10 to the right) on next iteration of loop

    Refer to cell to paste with Cells instead of Range

    so start with
    dim my_column as long
    my_column = 1
    and then within a loop:
    Cells(4,my_column)=Your_value_to_be_pasted
    my_column=my_column+10
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    04-11-2017
    Location
    Edinburgh, Scotland
    MS-Off Ver
    2010
    Posts
    110

    Re: Paste in to specifed columns (10 to the right) on next iteration of loop

    Perfect, thanks Kaper.

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: Paste in to specifed columns (10 to the right) on next iteration of loop

    Glad to hear it works and thanks for Rep. point and for marking thread SOLVED :-)

+ 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] How to move to next iteration of a Do Until loop
    By DannyJ in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-21-2017, 08:10 AM
  2. [SOLVED] Go to next loop iteration if current loop has error
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-03-2016, 09:54 PM
  3. VBA - How to continue inner loop while going to next iteration of outer loop?
    By alviniac in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-14-2015, 11:21 PM
  4. jump to xth iteration of for next loop
    By ammartino44 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-25-2015, 12:07 PM
  5. [SOLVED] Last Iteration of Loop?
    By saintplay in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-17-2015, 08:19 PM
  6. [SOLVED] Loop fails on 2nd iteration
    By capson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-14-2014, 01:38 PM
  7. [SOLVED] [SOLVED] Loop: Copy and paste range that changes with every iteration
    By Allen Geddes in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-15-2005, 09:10 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