0
Thanks

A few words of thanks would be greatly appreciated.

Excel - A macro to perform calculation and save data on another sheet




Issue


I have a series of account numbers customers in column A. This list is of variable size.
My need is:
  • I have divided the list into pages of 40 counts.
  • I take 40 accounts in column A
  • I copy and I stick to a new sheet 1.
  • I am following the 40 and I paste them into a sheet 2. And etc ... until the last of the list. Could you help me, because VBA books for now it's Chinese to me? Thank you!

Solution


An example of how it should be:
Sub exploding () Dim sh As Worksheet, numf As Long, row As Long Set sh = ActiveSheet Application.ScreenUpdating = False numf = 1: = 1 For lig lig sh = 1 To. [A65536]. End (xlUp) Worksheets.Add after: = Worksheets (Worksheets.Count) ActiveSheet.Name = "Part" & numf ActiveSheet.Range ("A1: A40") = sh.Cells (lig, 1). Resize (40, 1). Value = lig lig + numf 39 + 1 = numf lig sh.Activate Next Application.ScreenUpdating = True End Sub 

You select the sheet in question before running the macro.
  • If he has a name determined replace:
  • Set sh = ActiveSheet
    • by:
  • Set sh = Worksheets ("name_ofthe_sheet)
0
Thanks

A few words of thanks would be greatly appreciated.

Ask a question
Jean-François Pillou

CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jeff Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.

Learn more about the CCM team

Published by . Latest update on by aakai1056.

This document, titled "Excel - A macro to perform calculation and save data on another sheet," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (https://ccm.net/).

0 Comments