Results 1 to 3 of 3

Checking for true value cells and pasting part of each row to another sheet.

Threaded View

  1. #1
    Registered User
    Join Date
    01-05-2012
    Location
    Swindon, England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Checking for true value cells and pasting part of each row to another sheet.

    Hi,

    I am very inexperienced on Excel and am currently trying to create a way in which i can check using a macro or some VBA code to see what cells have been chosen and once they are chosen they need to be pasted to another sheet. The problem I am having is that once more than 1 cell has been chosen i can't seem to work out how to paste multiple lines. The other problem i am having is that at the same time i need to be checking if something has already been pasted to the line on the other sheet and if so it needs to go down to the next row. I have found a way but there must be an easier way. The way this is looking i am going to end up with 1000's of lines of code and am just wondering if anyone has a tidier, more efficient way of doing this. I have included the code i have so far.

    Sub Compiler()
        
        Sheets("Red X Customer List").Select
    If Range("N4").Value = True Then
        Range("A4:L4").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("Weekly Sheet").Select
        Range("A5").Select
     If Range("A5").Value = 0 Then
        ActiveSheet.Paste
        Sheets("Red X Customer List").Select
    
    ElseIf Range("A6").Value = 0 Then
        Range("A6").Select
        ActiveSheet.Paste
        Sheets("Red X Customer List").Select
    ElseIf Range("A7").Value = 0 Then
        Range("A7").Select
        ActiveSheet.Paste
        Sheets("Red X Customer List").Select
        
    If Range("N5").Value = True Then
        Range("A5:L5").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("Weekly Sheet").Select
        Range("A5").Select
     If Range("A5").Value = 0 Then
        ActiveSheet.Paste
        Sheets("Red X Customer List").Select
    
    ElseIf Range("A6").Value = 0 Then
        Range("A6").Select
        ActiveSheet.Paste
        Sheets("Red X Customer List").Select
    ElseIf Range("A7").Value = 0 Then
        Range("A7").Select
        ActiveSheet.Paste
        Sheets("Red X Customer List").Select
    
    End If
    End If
    End If
    End If
    End Sub
    Please excuse the various mistakes i have more than likely unintentionally made.

    Many Thanks,

    Gareth
    Last edited by Richard Buttrey; 01-05-2012 at 10:59 AM. Reason: Code tags added - please note

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