Results 1 to 3 of 3

Loop through columns to copy to a worksheet

Threaded View

  1. #1
    Registered User
    Join Date
    01-29-2014
    Location
    Idaho
    MS-Off Ver
    Excel 2010
    Posts
    3

    Loop through columns to copy to a worksheet

    Hi all,

    After scowering the forums I cannot find anything that works and I was hoping there is a siple loop or range line I can add to get this done. I would like to copy cells from one worksheet to another. This currently copies 2 cells from one worksheet to another but I would like it to do all rows down to 150 when I hit the update button. Here is what I have so far:

    Private Sub CommandButton1_Click()
    
    Dim SSN As String, ClaimentStatedEarnings As Integer
        Worksheets("Data").Select
        SSN = Range("A3")
        ClaimentStatedEarnings = Range("E3")
        Worksheets("Template").Select
        Worksheets("Template").Range("A1").Select
        If Worksheets("Template").Range("A1").Offset(1, 0) <> "" Then
        Worksheets("Template").Range("A1").End(xlDown).Select
        End If
        ActiveCell.Offset(1, 0).Select
        ActiveCell.Value = SSN
        ActiveCell.Offset(0, 1).Select
        ActiveCell.Value = ClaimentStatedEarnings
        Worksheets("Data").Select
        Worksheets("Data").Range("A3").Select
        
        
        
        
    End Sub
    Last edited by alansidman; 01-29-2014 at 05:51 PM. Reason: code tags added

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Loop to find data in a worksheet and copy into a different worksheet.
    By emily_k8_lewis in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-29-2013, 06:44 AM
  2. loop through columns in range and only copy columns that have value of 0
    By gherzberg in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-07-2012, 12:55 PM
  3. [SOLVED] VBA loop to copy a worksheet a number of times, assign name each time based on loop number
    By TBG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-29-2012, 10:54 PM
  4. Loop macro through all columns of worksheet
    By Berries in forum Excel Programming / VBA / Macros
    Replies: 28
    Last Post: 07-13-2010, 03:38 AM
  5. Copy multiple columns in a loop
    By rhudgins in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-08-2010, 07:45 PM

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