Excel - A macro to perform calculation and save data on another sheet
On February 15,2024 by Tom RoutleyIssue
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.
Article Recommendations
Latest articles
Popular Articles
Archives
- November 2024
- October 2024
- September 2024
- August 2024
- July 2024
- June 2024
- May 2024
- April 2024
- March 2024
- February 2024
- January 2024
- December 2023
- November 2023
- October 2023
- September 2023
- August 2023
- July 2023
- June 2023
- May 2023
- April 2023
- March 2023
- February 2023
- January 2023
- December 2022
- November 2022
- October 2022
- September 2022
- August 2022
- July 2022
- June 2022
- May 2022
- April 2022
- March 2022
- February 2022
- January 2022
- December 2021
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
- January 2021
Leave a Reply