select next sheet based on end of month for year previous sheet

Abdo

Board Regular
Joined
May 16, 2022
Messages
183
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Hi Guys

I need macro when the date of month from the year reach to finshing , then should move to next sheet . every sheet contains date in column A for instance when finish the date of JAN for the year into last row 1/31/ 2020 , then should move to next sheet contains month FEB and when finish the date of FEB for the year into last row 2/28/2020 then should move to next sheet contains month MAR and so on and when finishing DEC month and enter in new year 2021 ,then should start from sheet is relatingfor the new year .
start from this month for this year
month.xlsx
ABCDEFG
1ITEMCODEDESCIBEREFDEL.NQTY1QTY2
21/1/2020CMTR11BIG-DTR11RE41DL-121457676
31/1/2020CMTR21BIG-DTR21RE51DL-136789
41/1/2020CMTR3BIG-DTR3RE6DL-1487346
51/2/2020CMTR4BIG-DTR4RE7DL-153487
61/3/2020CMTR5BIG-DTR5RE8DL-1634178
71/4/2020CMTR6BIG-DTR6RE9DL-178907890
81/15/2020CMTR7BIG-DTR7RE10DL-1890433
91/15/2020CMTR8BIG-DTR8RE11DL-19876700
101/16/2020CMTR9BIG-DTR9RE12DL-2045800
111/17/2020CMTR10BIG-DTR10RE13DL-2167900
121/18/2020CMTR12BIG-DTR12RE15DL-23981100
131/19/2020CMTR13BIG-DTR13RE16DL-247688
141/20/2020CMTR14BIG-DTR14RE17DL-255490
151/28/2020CMTR15BIG-DTR15RE18DL-266787
161/29/2020CMTR16BIG-DTR16RE19DL-276787
171/30/2020CMTR17BIG-DTR17RE20DL-286787
181/31/2020CMTR18BIG-DTR18RE21DL-296787
sheet1

when finish the month should move to this sheet
month.xlsx
ABCDEFG
1ITEMCODEDESCIBEREFDEL.NQTY1QTY2
22/10/2020CMTR11BIG-DTR11RE41DL-121300
32/10/2020CMTR21BIG-DTR21RE51DL-1322
42/11/2020CMTR3BIG-DTR3RE6DL-141346
52/12/2020CMTR4BIG-DTR4RE7DL-152287
62/13/2020CMTR5BIG-DTR5RE8DL-16346
72/14/2020CMTR6BIG-DTR6RE9DL-175566
82/15/2020CMTR7BIG-DTR7RE10DL-189066
92/15/2020CMTR8BIG-DTR8RE11DL-1987667
102/15/2020CMTR9BIG-DTR9RE12DL-204534
112/16/2020CMTR10BIG-DTR10RE13DL-216722
122/17/2020CMTR12BIG-DTR12RE15DL-239812
132/18/2020CMTR13BIG-DTR13RE16DL-2411
142/19/2020CMTR14BIG-DTR14RE17DL-2590
152/28/2020CMTR15BIG-DTR15RE18DL-2687
sheet2

and when finsh FEB then should move to next sheet for month MAR
month.xlsx
ABCDEFG
1ITEMCODEDESCIBEREFDEL.NQTY1QTY2
23/1/2020CMTR11BIG-DTR11RE41DL-1211222
33/1/2020CMTR21BIG-DTR21RE51DL-1321
43/1/2020CMTR3BIG-DTR3RE6DL-141122
53/1/2020CMTR4BIG-DTR4RE7DL-152222
63/2/2020CMTR5BIG-DTR5RE8DL-163422
73/2/2020CMTR6BIG-DTR6RE9DL-174444
83/2/2020CMTR7BIG-DTR7RE10DL-1844266
93/3/2020CMTR8BIG-DTR8RE11DL-1922267
103/4/2020CMTR9BIG-DTR9RE12DL-2011134
113/5/2020CMTR10BIG-DTR10RE13DL-2111422
123/6/2020CMTR12BIG-DTR12RE15DL-232312
133/7/2020CMTR13BIG-DTR13RE16DL-2411
143/8/2020CMTR14BIG-DTR14RE17DL-2590
153/9/2020CMTR15BIG-DTR15RE18DL-2687
163/10/2020CMTR16BIG-DTR16RE19DL-2788
173/11/2020CMTR17BIG-DTR17RE20DL-2889
183/12/2020CMTR18BIG-DTR18RE21DL-2990
193/13/2020CMTR19BIG-DTR19RE22DL-3091
203/14/2020CMTR20BIG-DTR20RE23DL-3192
213/15/2020CMTR21BIG-DTR21RE24DL-3293
223/16/2020CMTR22BIG-DTR22RE25DL-3394
233/17/2020CMTR23BIG-DTR23RE26DL-3495
243/18/2020CMTR24BIG-DTR24RE27DL-3596
253/19/2020CMTR25BIG-DTR25RE28DL-3697
263/20/2020CMTR26BIG-DTR26RE29DL-3798
273/21/2020CMTR27BIG-DTR27RE30DL-3899
283/22/2020CMTR28BIG-DTR28RE31DL-39100
293/23/2020CMTR29BIG-DTR29RE32DL-40101
303/24/2020CMTR30BIG-DTR30RE33DL-41102
313/25/2020CMTR31BIG-DTR31RE34DL-42103
323/26/2020CMTR32BIG-DTR32RE35DL-43104
333/27/2020CMTR33BIG-DTR33RE36DL-44105
343/28/2020CMTR34BIG-DTR34RE37DL-45106
353/29/2020CMTR35BIG-DTR35RE38DL-46107
363/30/2020CMTR36BIG-DTR36RE39DL-47108
373/31/2020CMTR37BIG-DTR37RE40DL-48109
sheet3
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
it's been solved by mr.jindon
here is the solution if anybody interests
VBA Code:
Sub test()
    Dim ws As Worksheet
    Set ws = IIf(ActiveSheet.Index = Sheets.Count, Sheets(1), ActiveSheet.Next)
    With Range("a" & Rows.Count).End(xlUp)
        If WorksheetFunction.EoMonth(.Value, 0) = .Value Then
            Application.Goto ws.[a1], True
        End If
    End With
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,215,155
Messages
6,123,332
Members
449,098
Latest member
thnirmitha

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