+ Reply to Thread
Results 1 to 4 of 4

Add Transpose to line of code

Hybrid View

  1. #1
    Registered User
    Join Date
    05-29-2017
    Location
    England
    MS-Off Ver
    365
    Posts
    17

    Add Transpose to line of code

    Hi can anyone help?

    I want to add transpose to the Copy ToSht.Range, is there a way to do this?

    Private Sub CommandButton3_Click()
    
        Set FromSht = Sheets("Sheet1")
        Set ToSht = Sheets("Sheet2")
        
        r = 2
        
        While FromSht.Cells(r, "A") <> "" And FromSht.Cells(r, "C") <> ""
            
        r = r + 1
        
        Wend
        
        If FromSht.Cells(r, "A") <> "" Then
            
        FromSht.Cells(r, "C") = 1
            
        FromSht.Range("A" & r & ":B" & r).Copy ToSht.Range("AK20:AL20")
        
        End If
    
    End Sub
    I would like the copy to transpose to AK20:AK21


    Any help would be apprieciated

    Regards

    pwill32
    Last edited by pwill32; 06-30-2017 at 03:39 PM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Add Transpose to line of code

    Try something like:

    
        Range("E3:F3").Copy
        Range("K2").PasteSpecial Transpose:=True

    Or


    
        Range("E3:F3").Copy
        Range("K2").PasteSpecial Paste:=xlPasteValues, Transpose:=True
    Last edited by mehmetcik; 06-30-2017 at 07:50 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    05-29-2017
    Location
    England
    MS-Off Ver
    365
    Posts
    17

    Re: Add Transpose to line of code

    Thanks

    mehmetcik

    Regards

    pwill32

  4. #4
    Registered User
    Join Date
    05-29-2017
    Location
    England
    MS-Off Ver
    365
    Posts
    17

    Re: Add Transpose to line of code

    Sorry didn't know about this rule, I will make sure I add links in future

    No disrespect intended

    Regards

    pwill32

+ 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. Transpose column & line of table automatically via VBA
    By BenChek78 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-21-2015, 07:37 AM
  2. [SOLVED] Duplicate line and transpose data
    By Efjoker in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-19-2014, 02:19 AM
  3. [SOLVED] Transpose data from a excel template in a line wise
    By itsmesunilb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-02-2012, 12:59 PM
  4. Transpose to the next available line
    By gherzberg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-23-2012, 03:04 PM
  5. Macro to Duplicate Line + Transpose Data
    By flarel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-28-2012, 05:07 AM
  6. Transpose Macro for single line consolidation
    By cmross2010 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-24-2012, 02:50 PM
  7. How to collapse Data into one line (similar to a transpose, but not quite)
    By dyoung66 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-05-2008, 11:48 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