• 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.

Macros data from Row to Col required

Techtrend

Member
Sheet 3 Has
SYMBOL / OPEN / HIGH / LOW / PRICE
End of the day i copy the data to this Sheet 3
The same has to be Copied in List sheet one below the other.

For ex

SYMBOL OPEN HIGH LOW PRICE
ACC 1312.05 1343 1312.05 1334.05

Has to be copied to List sheet 15 Col under b,C,D,E COl

next

SYMBOL OPEN HIGH LOW PRICE

ADANIENT 127.4 132.9 126.75 129.2

and next are formulas for every script

Has to be copied to List sheet 15 Col under Q,R,S,T COl

The next days data will go under 16 Col Vice versa

New to macros,Can u pl help me on the same
 

Attachments

AlanSidman

Well-Known Member
This should work for you so long as your companies are listed in the same order in both sheets. Failure to have the listings exactly the same will produce erroneous results. I did notice in your sample that not all companies are listed on both sheets. Therefore the caution.

Code:
Option Explicit

Sub transfer()
    Application.ScreenUpdating = False
    Application.Calculation = xlCalculationManual
    Dim s1 As Worksheet, s2 As Worksheet
    Set s1 = Sheets("LIST")
    Set s2 = Sheets("Sheet3")
    Dim i As Long, lr As Long, lc As Long, j As Long, lr2 As Long
    lr = s1.Range("B" & Rows.Count).End(xlUp).Row + 1
    lr2 = s2.Range("A" & Rows.Count).End(xlUp).Row
    lc = s1.Cells(1, Columns.Count).End(xlToLeft).Column
    j = 1
    For i = 2 To lr2
        s1.Cells(lr, j) = Date
        s1.Cells(lr, j + 1) = s2.Range("E" & i)
        s2.Range("B" & i & ":D" & i).Copy s1.Cells(lr, j + 2)
        s1.Range(Cells(lr - 1, j + 5), Cells(lr - 1, j + 13)).Copy s1.Cells(lr, j + 5)
        j = j + 15
    Next i
    Application.CutCopyMode = False
    Application.Calculation = xlCalculationAutomatic
    Application.ScreenUpdating = True
    MsgBox "complete"



End Sub
 

AlanSidman

Well-Known Member
The code i added give errors might be bcaz of this
Well, first of all,I am not a mind reader so I cannot diagnose your issue as you have not provided the code you added that is causing you issues. Additionally, when you get error on the code, what is the error message and when you get the error message and click on debug, which line of code is highlighted. Without this information, I cannot help.

Secondly, when I try to load your file, it crashes my computer. Done with that! We don't need the entire file, only a sample representative of the original. However, having said that, it must be laid out exactly as the original for any code provided to work.

And finally, I no longer do freelance work and only help on forums but I do not take on projects. Suggest you look in your community for a skilled programmer that can sit with you and understand your needs. It will be less expensive. When I did freelance, my billing rate was $85/hour US to give you an understanding of what a project may cost.

If you are willing to provide the necessary information in this thread as outlined above, as time is available, I will try to help.
 
Top