Hi experts,
every month for every year I should copy data from lisbox to form.
I have code to show data in list box , what I want .
1- first when show data in listbox1 then copy data from form to sheet for current month based on condition, the condition is when reach specific days for current month (27 or 28 or 29 or 30 or 31) . so one of theses is enough to copy to sheet.
2- when copy to sheet then will add headers (MONTH,NAME,ITEM,BALANCE) ,but for each range
result in sheet
3- if I try copy data when days of dates for current month 27 or 28 or 29 or 30 or 31 and the current month is already copied then well show message" Jan month is already existed, you can't copy again ,sorry!"
4- if I try copy from listbox before days of dates ( 27 or 28 or 29 or 30 or 31) then will not copy from userform to sheet until reach on of days and show message by inform me how many remaining days to reach days of dates ( 27 or 28 or 29 or 30 or 31).
5- if I forgot copy current month for instance FEB and current month is MAR then will copy data for FEB month before.
ignoring conditions days of dates ( 27 or 28 or 29 or 30 or 31) because it leaves and enter new month(MAR) like this.
other meaning any missed month should copy before when try copying current month.
result in form sheet.
after copy FEB month remember I try copy MAR so when doesn't reach days of dates ( 27 or 28 or 29 or 30 or 31) then will show message as I mentioned above.
as you notice there is no current month(MAR) until apply condition for days of dates ( 27 or 28 or 29 or 30 or 31) , if reach days of dates ( 27 or 28 or 29 or 30 or 31) then will be like ,
last thing the data will increase in listbox so when show month in column A then will merge cells until TOTAL word in column B .
I hope finding solution.
every month for every year I should copy data from lisbox to form.
I have code to show data in list box , what I want .
1- first when show data in listbox1 then copy data from form to sheet for current month based on condition, the condition is when reach specific days for current month (27 or 28 or 29 or 30 or 31) . so one of theses is enough to copy to sheet.
2- when copy to sheet then will add headers (MONTH,NAME,ITEM,BALANCE) ,but for each range
result in sheet
Sample 2 v0 a.xlsm | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | MONTH | ITEM | NAME | BALANCE | ||
2 | Jan-25 | 1 | ALI | -10,000.00 | ||
3 | 2 | ALILA | 1,000.00 | |||
4 | TOTAL | -9,000.00 | ||||
FORM |
3- if I try copy data when days of dates for current month 27 or 28 or 29 or 30 or 31 and the current month is already copied then well show message" Jan month is already existed, you can't copy again ,sorry!"
4- if I try copy from listbox before days of dates ( 27 or 28 or 29 or 30 or 31) then will not copy from userform to sheet until reach on of days and show message by inform me how many remaining days to reach days of dates ( 27 or 28 or 29 or 30 or 31).
5- if I forgot copy current month for instance FEB and current month is MAR then will copy data for FEB month before.
ignoring conditions days of dates ( 27 or 28 or 29 or 30 or 31) because it leaves and enter new month(MAR) like this.
other meaning any missed month should copy before when try copying current month.
result in form sheet.
Sample 2 v0 a.xlsm | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | MONTH | ITEM | NAME | BALANCE | ||
2 | Jan-25 | 1 | ALI | -10,000.00 | ||
3 | 2 | ALILA | 1,000.00 | |||
4 | TOTAL | -9,000.00 | ||||
5 | ||||||
6 | MONTH | ITEM | NAME | BALANCE | ||
7 | Feb-25 | 1 | ALI | -10,000.00 | ||
8 | 2 | ALILA | 1,000.00 | |||
9 | TOTAL | -9,000.00 | ||||
FORM |
after copy FEB month remember I try copy MAR so when doesn't reach days of dates ( 27 or 28 or 29 or 30 or 31) then will show message as I mentioned above.
as you notice there is no current month(MAR) until apply condition for days of dates ( 27 or 28 or 29 or 30 or 31) , if reach days of dates ( 27 or 28 or 29 or 30 or 31) then will be like ,
Sample 2 v0 a.xlsm | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | MONTH | ITEM | NAME | BALANCE | ||
2 | Jan-25 | 1 | ALI | -10,000.00 | ||
3 | 2 | ALILA | 1,000.00 | |||
4 | TOTAL | -9,000.00 | ||||
5 | ||||||
6 | MONTH | ITEM | NAME | BALANCE | ||
7 | Feb-25 | 1 | ALI | -10,000.00 | ||
8 | 2 | ALILA | 1,000.00 | |||
9 | TOTAL | -9,000.00 | ||||
10 | ||||||
11 | MONTH | ITEM | NAME | BALANCE | ||
12 | Mar-25 | 1 | ALI | -10,000.00 | ||
13 | 2 | ALILA | 1,000.00 | |||
14 | TOTAL | -9,000.00 | ||||
FORM |
last thing the data will increase in listbox so when show month in column A then will merge cells until TOTAL word in column B .
I hope finding solution.