Results 1 to 15 of 15

Copy and paste from one sheet to another leaving out hidden cells

Threaded View

si_1970 Copy and paste from one sheet... 06-19-2013, 02:36 AM
JOHN H. DAVIS Re: Copy and paste from one... 06-19-2013, 07:50 AM
si_1970 Re: Copy and paste from one... 06-19-2013, 08:02 AM
JOHN H. DAVIS Re: Copy and paste from one... 06-19-2013, 08:24 AM
AB33 Re: Copy and paste from one... 06-19-2013, 08:28 AM
si_1970 Re: Copy and paste from one... 06-19-2013, 09:03 AM
JOHN H. DAVIS Re: Copy and paste from one... 06-19-2013, 09:31 AM
si_1970 Re: Copy and paste from one... 06-19-2013, 09:35 AM
JOHN H. DAVIS Re: Copy and paste from one... 06-19-2013, 10:19 AM
JOHN H. DAVIS Re: Copy and paste from one... 06-19-2013, 11:12 AM
AB33 Re: Copy and paste from one... 06-19-2013, 09:49 AM
AB33 Re: Copy and paste from one... 06-19-2013, 01:03 PM
JOHN H. DAVIS Re: Copy and paste from one... 06-19-2013, 02:00 PM
AB33 Re: Copy and paste from one... 06-19-2013, 05:24 PM
JOHN H. DAVIS Re: Copy and paste from one... 06-20-2013, 06:41 AM
  1. #1
    Registered User
    Join Date
    06-19-2013
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Copy and paste from one sheet to another leaving out hidden cells

    Hi all,

    First time poster and a novice at using vba but learning quickly. The more I learn the more impressed I am by how vba can make life so much easier if you have to constantly update data in spreadsheets...............which my employer loves (why bother asking someone if they take suger in their coffee when you can create a spreadsheet that contains everyones sugar requirements and then tell some poor sod to keep it updated).

    I am trying to use a vba code to copy data from various cells on one worksheet (leaving out hidden cells) and then paste the data into every seventh row on a second worksheet (in the same workbook). I have used an editing vba code found on this site to copy and paste the data as required but the code is also copying data from hidden rows.


    The code that i am using is......

    Sub CopyDataEvery7th()
        Dim i As Long, j As Long, nLastRow As Long
        Dim ws1 As Worksheet, ws2 As Worksheet
        
        Set ws1 = Worksheets("ExDRIE")
        Set ws2 = Worksheets("List")
        nLastRow = ws1.Cells(ws1.Rows.Count, "A").End(xlUp).Row
        'Start on Row 13 with List
        j = 4
        For i = 13 To nLastRow
            'Copy Code
            ws2.Cells(j, "A") = ws1.Cells(i, "I")
            'Copy Name
            ws2.Cells(j, "B") = ws1.Cells(i, "H")
            'Copy ID2
            ws2.Cells(j, "C") = ws1.Cells(i, "D")
            'With List every Seventh Row
            j = j + 7
        Next i
    End Sub
    Thanks in advance for any help
    Last edited by arlu1201; 06-19-2013 at 05:07 AM. Reason: Use code tags as per forum rule 3.

Thread Information

Users Browsing this Thread

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

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