Hi all,
IMG1.jpg
I'm trying to divide the items of an array over 3 columns
Like in the image above.
I've tried the following but without succes
![]()
Please Login or Register to view this content.
Hi all,
IMG1.jpg
I'm trying to divide the items of an array over 3 columns
Like in the image above.
I've tried the following but without succes
![]()
Please Login or Register to view this content.
Hi again Jonathan78
Using exactly the ideas ( and a lot of the code ! ) that I showed you here yesterday:
http://www.excelforum.com/showthread...t=#post4381996
This code is much simpler version of that. .....!....
It will take for example this![]()
Please Login or Register to view this content.
Using Excel 2007
Row\Col A B C D E F G H I J 1 1 Area 1 Area 59 6 1 1 any 3 Finks
pgcArraysSplitToColumn
And it will give you this
Row\Col A B C 40 1 Area 1 Area 59 41 6 1 1 42 any 3 Finks
And here a simplified code version ( Note to run it you still need the Function shgMathsVBASHimpfGlified copied to the same module as the Main code )
![]()
Please Login or Register to view this content.
Alan
Jack ....done it nice ??
Last edited by Doc.AElstein; 05-10-2016 at 12:49 PM.
'_- Google first, like this _ site:ExcelForum.com Gamut
Use Code Tags: Highlight code; click on the # icon above,
Post screenshots COPYABLE to a Spredsheet; NOT IMAGES PLEASE![]()
http://www.excelforum.com/the-water-...ml#post4109080
https://app.box.com/s/gjpa8mk8ko4vkwcke3ig2w8z2wkfvrtv
http://excelmatters.com/excel-forums/ ( Scrolll down to bottom )
![]()
Please Login or Register to view this content.
Bernie Deitrick
Excel MVP 2000-2010
Exactly what I was looking for, Thanks Bernie!
Thanks Doc.AElstein, but I go for the shorter solution
Since I finished this after the other posts, here it is for what it is worth.
Keep in mind that simple or short solutions are not always optimized for speed. Settings like ScreenUpdating, Calculation, Events, and such can be used to help with speed issues. My Speedup routines: http://vbaexpress.com/kb/getarticle.php?kb_id=1035
I find that writing to an array and then writing to a range all at once is faster than one cell at a time. For your scenario, speed should not be a significant issue.
![]()
Please Login or Register to view this content.
Thanks Kenneth Hobson and Bernie Deitrick for adding here
Alan
_..
And here just a couple of versions of my code that do not need the Column Letter Function ( Function to get the Column Letter from Column Number )
The original Function is simply included in the main code line in the first code.
![]()
Please Login or Register to view this content.
_................................
For the second a simple Function to get the Column Letter from Column Number is incorporated into the main Code
![]()
Please Login or Register to view this content.
As before for thes examples, this is the Input Range.
Using Excel 2007
Row\Col A B C D E F G H I J 1 1 Area 1 Area 59 6 1 1 any 3 Finks
Output is
Using Excel 2007
Row\Col A B C 40 1 Area 1 Area 59 41 6 1 1 42 any 3 Finks
_..........................................................
So Last column is ( lClm ) is 9
Wanted Width ( Widf ) is 3
Wanted Top left is A40
Last edited by Doc.AElstein; 05-11-2016 at 02:58 AM. Reason: Addae a coule of alternatives
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks