-
Solved: Sort Rows Horizontally
In this example the data gets transferred from sheet"Lotto 649" to Sheet"Draw" then I need to sort the the row horizontally and I do this with a macro I've recorded (see cmd button in sheet "Draw"
Because of the range I can only sort row A3.
I've tried to incorporate the sorting code to the transferring code with a "with selection etc" ... and that does not work.
Wish I could paste the two codes here but I still have to figure out how to do this in this forum
Thank you
-
To simplify things, select each of your circles and set the properties to "Don't move or size with cells" This avoids the need to paste special
The following copies and orders your results
[VBA]
Sub Addto6_49()
Sheets("Lotto 649").Range("B1:G1").Copy _
Sheets("Draw").Cells(Rows.Count, 1).End(xlUp).Offset(1)
With Sheets("Draw").Cells(Rows.Count, 1).End(xlUp)
.Range("A1:F1").Sort _
Key1:=.Range("A1"), Order1:=xlAscending, Orientation:=xlLeftToRight
End With
End Sub
[/VBA]
To post code here, just copy and paste it from your modules, then select it and click the VBA button
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
-
Malcom thank you ... Works great!
Regards,
Nick
-
I was wondering what if there are duplicate numbers? I tried it with duplicate numbers and the macro only included the one of the two numbers.
-
Hello Noobie,
not sure I understand why you would have a problem ... it works for me.
Here is a sample ... If I misunderstodd you please elaborate
Regards
Nick
-
Thanks for your response. I've found what I needed in another thread.
I'm also a newbie in this, so currently i have to depend on the forum for help. Good luck!
-
Hi Noobie,
Can you share yiour problem/solution for the benefit of others who arrive at this thread?
Regards
MD
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
-
Hi,
I tried using a macro from a thread which i can't remember. But failed. So I had to post another thread. Pls see this thread for further understanding.
http://www.vbaexpress.com/forum/showthread.php?t=10281
Thanks once again!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules