Resize data to specified number of rows

Momentman

Well-known Member
Joined
Jan 11, 2012
Messages
4,156
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I want to transform the data shown below to a number of rows specified by the user. So if the user specifies 19, the data is changed to 10rows and x columns as required to capture the whole data. See below

Excel 2013
ABCDEFG
12348023937941abakiliki23480282189592348032248256anuofia2348029826822kareem
22348024132764234802071878623480214295022348031992629234803173549223480227000762348022929526
32348022094860234802212051223480274714462348020795256234802312015723480244623232348023313251
42348028401550234803045952323480270327052348031307087234802233634723480219064172348027769701
52348029653191234802875894123480238962342348020421257234802212745023480241463552348030762446
62348023303526234802265214723480216435482348023930684234802251838723480221793432348023728081
72348030913626234802623298223480224354802348024680695234802672057623480265252982348030712868
82348030872508234802661435223480255749732348030724001234802004935923480226467972348030419983
92348030358425234802455075623480320796412348025887935234802701398023480277162262348027219194
102348020046493234802551278123480284133782348032171294234802604670723480234091042348026608798
112348027874834234802006814723480210718122348030714657234802230380023480204192252348023667890
122348031414655234803225277723480220502612348028147894234803018400723480223987642348021268620
132348025566802234802798896223480218278602348027103483234802342447923480265597662348020373561
1423480226339722348024676893234802231304023480310924352348026489812
1523480234525622348026705639234802391724923480322570412348028747724
Sheet7


1. The new data should be pasted in the next empty column
2. Any data that doesn't start with 234 should not be in the transformed output
 
Last edited:

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
The result would look like this

Excel 2013
KLM
1234802393794123480278748342348026232982
2234802413276423480314146552348026614352
3234802209486023480255668022348024550756
4234802840155023480226339722348025512781
5234802965319123480234525622348020068147
6234802330352623480207187862348032252777
7234803091362623480221205122348027988962
823480308725082348030459523
923480303584252348028758941
1023480200464932348022652147
Sheet7
 
Upvote 0
Let me try simplify

Can I get a VBA code to resize this data

The raw data is in columns A to C and has uneven number of rows but i want to transform to exactly 6 rows and as many columns as are necessary as in the data below


Excel 2013
ABCDEFGHI
1amvagmsy
2bnwbhntz
3coxciou
4dpydjpv
5eqzekqw
6frflrx
7gs
8ht
9iu
10j
11k
12l
Sheet1


I know i can easily loop but i have about 1,000,000 data points.

Thanks ffor helping out
 
Upvote 0

Forum statistics

Threads
1,215,276
Messages
6,124,006
Members
449,137
Latest member
abdahsankhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top