+ Reply to Thread
Results 1 to 2 of 2

Codes for transpose/copy to another worksheet

Hybrid View

  1. #1
    Registered User
    Join Date
    11-05-2007
    Posts
    34

    Codes for transpose/copy to another worksheet

    Hi guys,
    Anyone can help solve this problem?

    What I need to do is transpose a list of data into its own respective worksheet based on data in column c.
    For example if column C data is "Place1" the entire row of data will be copied and transpose into "Place1" worksheet.

    The below is the code that i am trying to write.

    Problem after execution of macro:

    It only adds row2 data into the respective worksheet but skip the rest of the data and add the last row data is added in the wrong data worksheet.


    I have also attached an example of my working file.

    For Each ce In ps.Range("C2:C" & ps.Cells(Rows.Count, "C").End(xlUp).Row)
            For Each ws In ActiveWorkbook.Worksheets
            
            If ce.Value = ws.Name Then
               
               If ws.Range("D1").Value = "" Then
             
                       ce.EntireRow.Copy
                       
                       ws.Range("D1").Select
                       
                       Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
                       False, Transpose:=True
                       
                       Application.CutCopyMode = False
                   
                Else
        
                       ce.EntireRow.Copy
            
                       ws.Range("IV1").End(xlToLeft).Offset(0, 1).Range("A1").Select
                        
                       Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
                       False, Transpose:=True
                        
                       Application.CutCopyMode = False
                   
                 End If
               
            End If
            
            Next ws
         Next ce
    Attached Files Attached Files
    Last edited by alien3011; 01-18-2008 at 04:28 AM.

  2. #2
    Registered User
    Join Date
    11-05-2007
    Posts
    34
    /bump
    Posting it up hoping to get reply

+ Reply to Thread

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