+ Reply to Thread
Results 1 to 2 of 2

Macro to paste formula in cells to every other row in new sheet

Hybrid View

  1. #1
    Registered User
    Join Date
    06-16-2016
    Location
    357
    MS-Off Ver
    2016
    Posts
    1

    Macro to paste formula in cells to every other row in new sheet

    I really need help creating a macro to copy the contents in column A in sheet 1 to every other row in sheet 2 column A without incrementing the cell reference more than 1. Thank you

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,704

    Re: Macro to paste formula in cells to every other row in new sheet

    try this

    Option Explicit
    
    Sub everyother()
        Dim s1 As Worksheet, s2 As Worksheet
        Set s1 = Sheets("Sheet1")
        Set s2 = Sheets("Sheet2")
        Dim r1 As Long, r2 As Long
        r1 = s1.Range("A" & Rows.Count).End(xlUp).Row
        Dim i As Long
        Application.ScreenUpdating = False
        For i = 1 To r1
            r2 = s2.Range("A" & Rows.Count).End(xlUp).Row
            s1.Range("A" & i).Copy s2.Range("A" & r2 + 2)
        Next i
        Application.CutCopyMode = False
        Application.ScreenUpdating = True
        MsgBox "Action completed"
    End Sub
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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 Macro to copy & paste non-adjacent cells from one sheet to another
    By clo2peter in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-20-2014, 03:06 PM
  2. [SOLVED] VBA or Macro to copy highlighted cells and paste into a new sheet
    By retroboy17 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-29-2014, 12:02 PM
  3. [SOLVED] Excel Macro to lookup sheet name with a range of cells and paste in the reference sheet
    By mishaq in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-08-2013, 02:55 PM
  4. [SOLVED] Macro to paste cells from one sheet into another
    By ayvee0 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-30-2013, 03:00 PM
  5. Copy Paste cells into a new sheet based on criteria macro
    By Clessie1919 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-19-2012, 02:43 AM
  6. macro to cut & paste selected cells into new sheet
    By xforum142riidax in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-12-2011, 04:28 PM
  7. Replies: 3
    Last Post: 02-08-2010, 11:44 AM
  8. Macro to copy range of cells and paste into 1 sheet
    By Dean in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-19-2006, 08:55 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