Hey there, I`m quite new here and in programming macros in excel either, yet I managed to programm some macros already. But now I stuck. I`m not a native english speaker, so I hope I can communicate my problem in a comprehensive way.
My spreadsheet include statistics about company`s. For example, column 1: Date, column 2: Stock price at this date, column 3: market capitalization at this date and so on. From column Q on the same date is listed for company 2, from column AG on for company 3 and so forth. Every column has 89 rows. Now I want this data to be listed one below the other. (the companies one below the other) Specifically, I want to leave one row empty under company 1, and then list the Data for company 2 starting in row 91. So I have to copy for company 2 date from columns Q-AF and from rows 1-89 and paste this in cell A91. I got over 250 companies in my sheet so I can`t execute that manually. I also tried a bit with macros and this is what I got (and what obviously didn`t work):
Sub neu()
'** Determination of the last column in row 1
ls = Cells(1, Columns.Count).End(xlToLeft).Columns.Column
Dim s As Integer
For s = ls To 1 Step -1 ' Backwards counting to column 1
'** Ask, if the first row says: "Date"
If Cells(1, s).Value = "Date" Then
'** If it says, then should the following range be selected (from cell "date" on)
Range(Cell(1, s), Cell(90, s & 17)).Select
Selection.Copy
'**Next it should be pasted into the second empty cell below the prevailing data (Don`t know how to model this)
Range("A65536").End(xlUp).Paste
End If
Next s
End Sub
So, I hope this is somewhat understandable
Best regards and thanks in advance
Prinzboldi
Bookmarks