Transpose data by modifying an old macro

AussieSteve

New Member
Joined
Dec 28, 2017
Messages
18
Hi guys.
Need a little help adding some code to a macro, that was an inquiry back in April this year on this forum. This the sample code.


Sub DoLoop()

Dim Rng As Range
Set Rng = Range("E1", Range("E" & Rows.Count).End(xlUp))
Dim c As Range
Set c = Rng.Find("MarketPlace", , , xlWhole, , xlNext, True, , False)
Application.ScreenUpdating = False
Do While Not c Is Nothing
'The below line of code, where it is to copy data,This is what I want to modify by adding transpose to the code, I cannot
'seem to get it to work.

c.Resize(, 3).Copy c.Offset(5, -3)
c.Resize(, 3).ClearContents
Set c = Rng.FindNext(c)
Loop
Application.ScreenUpdating = True
End Sub

As always any help is greatly appreciated.
 

Some videos you may like

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
8,912
Try:
Code:
Sub DoLoop()
    Dim Rng As Range
    Set Rng = Range("E1", Range("E" & Rows.Count).End(xlUp))
    Dim c As Range
    Set c = Rng.Find("MarketPlace", , , xlWhole, , xlNext, True, , False)
    Application.ScreenUpdating = False
    Do While Not c Is Nothing
        c.Resize(, 3).Copy
        c.Offset(5, -3).PasteSpecial Transpose:=True
        c.Resize(, 3).ClearContents
        Set c = Rng.FindNext(c)
    Loop
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
End Sub
 

AussieSteve

New Member
Joined
Dec 28, 2017
Messages
18
Reply to Mumps.
Thank you for your help, it works for me. I know that was simple for you, frustration told me to go here get it out of my head and move on.
Thanks again Steve.
 

Watch MrExcel Video

Forum statistics

Threads
1,096,305
Messages
5,449,563
Members
405,571
Latest member
Flux1234

This Week's Hot Topics

Top