• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

copying data from specific range

memot

New Member
Hello,

Here is an example file, could you please help me to create a macro to copy data from table to "A" and "B" sheets? In the file you could understand easily what i meant..

When i run the macro, it should copy the data from DATE01 - A column and paste transpose to DATE 01 in "A" sheet. I wrote the numbers to be more clear.

Thank you!
 

Attachments

  • Example macro (1).xlsx
    10.8 KB · Views: 1
Hi !

You should start to create it activating Macro Recorder
and using Excel basics functions, beginner level !

Amend this demonstration to your need :​
Code:
Sub Demo()
Application.ScreenUpdating = False
Worksheets(3).[D4].CurrentRegion.Offset(2).Clear
 
For W% = 1 To 2
    With Worksheets(W).[A2].CurrentRegion.Columns
        With .Item(2).Resize(, .Count - 1).Rows
            For R& = 1 To .Count
                .Item(R).Copy
                Worksheets(3).Cells(6, 2 + W + R * 2).PasteSpecial Transpose:=True
            Next
        End With
    End With
Next
 
Application.CutCopyMode = False
Application.Goto Worksheets(3).Cells(1), True
End Sub
Do you like it ? So thanks to click on bottom right Like !
 
Hi !

You should start to create it activating Macro Recorder
and using Excel basics functions, beginner level !

Amend this demonstration to your need :​
Code:
Sub Demo()
Application.ScreenUpdating = False
Worksheets(3).[D4].CurrentRegion.Offset(2).Clear

For W% = 1 To 2
    With Worksheets(W).[A2].CurrentRegion.Columns
        With .Item(2).Resize(, .Count - 1).Rows
            For R& = 1 To .Count
                .Item(R).Copy
                Worksheets(3).Cells(6, 2 + W + R * 2).PasteSpecial Transpose:=True
            Next
        End With
    End With
Next

Application.CutCopyMode = False
Application.Goto Worksheets(3).Cells(1), True
End Sub
Do you like it ? So thanks to click on bottom right Like !

Hello Marc, thanks for the reply. Actually i know how to record a macro and make a beginner level one. But i have a macro file which opens the specific file and have thousands of cells, so i was looking for an effective, simple codes.

For example it goes to the end of the table (without giving specific range) or it could write the Date 1 , Date 2 etc. Thanks anyway i will check your codes and see if i could adapt to my main macro file.
 

My code works with your attached workbook …
Hello Marc, thanks again. But how does it work? I just added this code to a module and run it, code breaks as soon as it starts:

"For W% = 1 To 2"

W% ? what is it, code stops there..
 

Works like a breeze on my side ‼

So copy it to a new module with nothing else but my code !
 
Back
Top