+ Reply to Thread
Results 1 to 31 of 31

copy entire column instead of rows

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-08-2010
    Location
    ireland
    MS-Off Ver
    Excel 2007
    Posts
    121

    Re: copy entire column instead of rows

    Hi Alan,

    Thank for the follow up and your time.

    I have been playing with the original code myself. I have decided to make Name list same in all sheet, just to get to the solution. I know my variable range causes alot of the problem and took alot of your time.

    However, i have come to the following code and its working fine. only deviation i did is to make name list common.

    Private Sub Worksheet_Change(ByVal Target As Range)
    
    'http://www.ozgrid.com/forum/showthread.php?t=154637
    
        Dim strStatus As String
    
        Dim wsAwait As Worksheet
    
        Dim wsRmove As Worksheet
    
        Dim wsMList As Worksheet
    
        Dim lstrw As Long
    
        
    
        If Target.Column = 1 Then Exit Sub
    
        If Target.Row <> 1 Then Exit Sub
    
        If Target.Cells.Count > 1 Then Exit Sub
    
       
    
        Application.ScreenUpdating = False
    
        
    
          
    
        strStatus = Target.Value
    
        Set wsAwait = ThisWorkbook.Sheets("Awaiting")
    
        Set wsRmove = ThisWorkbook.Sheets("Remove")
    
        Set wsMList = ThisWorkbook.Sheets("Master List")
    
        lstrw = wsAwait.Rows.Count
    
        
    
        If strStatus <> "Move to Master List" Then
    
            Range(Target, Target.Offset(0, 2)).Copy
    
            Application.EnableEvents = False
    
            Select Case strStatus
    
                
    
            Case "Awaiting"
    
                'wsAwait.Range("A" & lstrw).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
    
                Columns(Target.Column).Copy wsAwait.Columns(wsAwait.Cells(2, Columns.Count).End(xlToLeft).Column + 1)
    
                
    
            Case "Remove"
    
                wsRmove.Range("A" & lstrw).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
    
                
    
            End Select
    Thanks once again Alan for the direction and effort

  2. #2
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: copy entire column instead of rows

    Hi
    Quote Originally Posted by shido View Post
    ...... I have decided to make Name list same in all sheet, just to get to the solution. I know my variable range causes a lot of the problem .........
    However, i have come to the following code and its working fine. only deviation i did is to make name list common........
    . Hi thanks for coming back – it was a difficult one so good to know how it came out, Thanks.
    . So basically you have “tidied up” or “restructured” the data to do away with all thet difficult chopping and changes of rows between Sheets with Ranges of different sites, along with some reordering of rows as you go along. – “Wow it is almost a mouthful just to say!!!”
    . I guess it is always a bit of a “chicken and Egg” situation , not knowing which is the less of the evils, - making the data better structured with all the work that entails, or developing a more complicated code, which as well as the time taken can , as you see take a while to debug / check that it works finally.
    . Happy Yous got there and that Yous may of least got some direction from the thread, so thanks for the feedback
    Alan
    .
    P.s.
    . I think now the codes are at or very close to working to meet your initial complicated criteria.
    . So can I ask if you have the time to reconsider renaming the Thread Title. This could help navigate someone searching for a solution to such a complicated requirement should they for any reason have to take that route.
    .
    . I would suggest a title sof the form
    “....Based On selection: Copying , Adjusting, Reordering Rows and Columns from Tables, then Pasting into different sized Tables in specific order...”... ( If you can fit that in!! )
    FYO
    . to do that :
    . Go to your first Post , Post #1
    . Hit Reply
    Attachment 418734

    . Scroll down and Hit Go Advanced
    Attachment 418735

    . Scroll up and you see you can Edit the Title
    Attachment 418736

    IMPORTANT : There is a Forum Bug. Your original Post can “vanish”. So before you start the above copy the entire contents of your first Post to the clipboard, so that if the worst occurs you can paste that post back in. ( Your text would probably be enough as that initial code you gave was not too relevant to the complicated criteria )

    . Hope that is all clear. Thanks in advance if you can do that. But its your Thread - so your decision.
    . Good luck with your project
    Alan
    '_- Google first, like this _ site:ExcelForum.com Gamut
    Use Code Tags: Highlight code; click on the # icon above,
    Post screenshots COPYABLE to a Spredsheet; NOT IMAGES PLEASE
    http://www.excelforum.com/the-water-...ml#post4109080
    https://app.box.com/s/gjpa8mk8ko4vkwcke3ig2w8z2wkfvrtv
    http://excelmatters.com/excel-forums/ ( Scrolll down to bottom )

+ 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. Replies: 1
    Last Post: 05-30-2015, 04:38 PM
  2. Alter existing formula to copy specific cells in row instead of copy entire column
    By painterartist in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-02-2014, 12:42 PM
  3. Search string in a column then copy entire rows to another sheet
    By vannylette in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-12-2013, 12:16 PM
  4. Replies: 1
    Last Post: 11-16-2012, 05:05 PM
  5. [SOLVED] Copy Entire Column Only Returning 1st 16 Rows?
    By rwr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-01-2012, 11:38 AM
  6. [SOLVED] Macro to Copy Entire Rows if Column Equals
    By Andrew.Trevayne in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-21-2012, 09:46 PM
  7. Replies: 0
    Last Post: 02-06-2009, 02:45 AM

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