Excel Macros - Grid Converted to Vertical Listing

J

Jason Heider

I have a file (Cash Wksht) which has the dates along the left hand side and
the name of each account along the top. The values are entered in their
respective locations on the grid. I am looking to develop a listing in a
separate spreadsheet (Daily Values)which would have column A - Date, column B
- Amount and column C - Name. I have been able to copy the date multiple
times but have been mostly unsuccessful with the rest of the data. Attached
is the macros I have developed:

Sub Macro2()

' Macro recorded 3/21/2006 by Jason Heider
'
Dim i As Integer

' Setup Initial Cell Position
Sheets("Daily Values").Select
Range("A8").Select

Do

'Paste Dates
Sheets("Cash Wksht").Select
Range("A10:A40").Select
Selection.Copy
Sheets("Daily Values").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveCell.Offset(rowOffset:=0, columnOffset:=1).Activate
Sheets("Cash Wksht").Select

' Paste Values

Range("B10:B40").Select
ActiveCell.Offset(rowOffset:=0, columnOffset:=i).Activate
' ActiveCell.Offset(30, 0).Select
Selection.Copy
Sheets("Daily Values").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveCell.Offset(rowOffset:=0, columnOffset:=1).Activate
Sheets("Cash Wksht").Select

' Paste Item Name
Range("B9").Select
ActiveCell.Offset(rowOffset:=0, columnOffset:=i).Activate
Selection.Copy
Sheets("Daily Values").Select
ActiveSheet.Paste
Application.CutCopyMode = False

' Move To End of Last Pasted Group
Range("A8").Select
Selection.End(xlDown).Select
ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Activate

' Index of 20 Columns
i = i + 1

Loop Until i > 20

End Sub

Please let me know if you can be of assistance.
Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top