+ Reply to Thread
Results 1 to 2 of 2

Thread: Needing Loop to copy/paste if there is info in the row

  1. #1
    Registered User
    Join Date
    12-21-2010
    Location
    Minnesota
    MS-Off Ver
    Excel 2007
    Posts
    1

    Needing Loop to copy/paste if there is info in the row

    Hello,

    I am quite a noob at programming in vba, and am looking for some help. I am needing to write a macro that would start at a defined cell in Sheet1 (A6) and then copy/paste that cell into a specified cell in another sheet inside the same workbook (Sheet2!A8). I then need a loop to repeat the copy/paste command as long as there is data in Sheet1, column A. Can anyone help me?

    Thanks so much!

  2. #2
    Forum Guru pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2010
    Posts
    5,155

    Re: Needing Loop to copy/paste if there is info in the row

    Hi feephan,
    Welcome to the forum

    Loops can be slow so finding all the cells with values first copy then paste
    Sub ftest()
    
    With Sheets("Sheet1")
    .Range("A6", Range("A6").End(xlDown)).Copy Destination:=Worksheets("Sheet2").Range("A8")
    End With
    End Sub
    regards pike

    If the solution helped please donate
    here to the RSPCA

    Sites worth visiting;

    J&R Solutions - royUK

    AJP Excel Information - Andy Pope

    Spreadsheet Toolbox

    VBA for smarties - snb

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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.2.0