+ Reply to Thread
Results 1 to 3 of 3

Copy and Paste Loop in Cells Only

  1. #1
    Registered User
    Join Date
    08-23-2022
    Location
    Scotland
    MS-Off Ver
    Windows 10
    Posts
    2

    Red face Copy and Paste Loop in Cells Only

    I would like to use VBA to automate the copying of one cell to the one below, on a loop. For example, cell A1 will contain text that I want to copy and paste into cell A2, then copy cell A2 and paste it into cell A3 and so on right through to line 3000 in column A. There will be different text in cells A6, A12, A18 which is why I can't just do a full column copy or drag the cells down. So cells A1-A5 will contain the same text, cells A6 to A11 different text and so on for every 6 cell increment. I'm rubbish with VBA so have no idea how to do this :-( Any help would be much appreciated.

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Copy and Paste Loop in Cells Only

    Assuming that your cells A6, A12, A18 are incorrect and should be A7, A13, A19 etc as you start in 1 and say that every 6 cell increments then the following will do it:
    Please Login or Register  to view this content.
    To provide an explanation to the above:
    Step1: The first For Loop picks up your initial values and moves 6 rows at a time therefore you get a for loop that goes 1,7,13,19 etc
    Step2: then we take the value in that cell
    Step3: Run another loop that goes from 1 to 5
    Step4: set the value of the cell in Row: Loop 1 value + loop2 value, Col: 1 to the value we set at the start
    Last edited by pjwhitfield; 08-23-2022 at 12:30 PM.
    If someone has helped you then please add to their Reputation

  3. #3
    Registered User
    Join Date
    08-23-2022
    Location
    Scotland
    MS-Off Ver
    Windows 10
    Posts
    2

    Re: Copy and Paste Loop in Cells Only

    You are a genius! Thanks so much, that's worked perfectly :-)

    Can I match the font down the whole column automatically?

+ 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] Loop through copy and paste cells VBA
    By Ollie7957 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-13-2019, 11:07 AM
  2. Loop to copy paste pivot table data changing the filter every time and copy it
    By PaulM100 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-22-2019, 06:58 AM
  3. VBA Loop - Copy and Paste Individual Cells
    By stansmith216 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-22-2019, 11:52 AM
  4. Replies: 3
    Last Post: 09-29-2014, 09:55 PM
  5. [SOLVED] Copy/Paste Loop Needs to Recognize Blank Cells
    By freybe06 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-07-2013, 11:50 AM
  6. [SOLVED] Copy Paste Loop ends before copy/paste is finished
    By brgr4u in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-08-2013, 04:01 PM
  7. [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

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