• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Date issue in VBA

ajaar

Member
Dear Friends,

I am having problem with two occasion in my code. can any one please help me.

1) trying to find column number in the below, mmonth is name of combobox where Date is selected in the format MMM-YYYY, it is not bring any column number. when I change 'Me.mmonth.value' to any normal text it is working fine

Code:
colNum = Application.WorksheetFunction.Match(Me.mmonth.Value, ActiveWorkbook.Sheets("Payment").Range("1:1"), 0)

2) I am trying to add one month to combobox 'mmonth2' as below. it is not adding the month.
Code:
mmonth2.Value = DateAdd("m", 2, mmonth.Value)

Thanks in advance.
Ajaar
 
Ajaar

can you please post your file wit details of where it is not working
 
Dear Hui,
Thank you for time.
I have attached file here with, I am trying to achieve the below.
1)when I select a Date in combobox mmonth, I wanted to add one month to combobox mmonth2 and two month to combobox mmonth3 and so on.
2)When I click update, it is to update the Amount in the accurate row in the sheet payment.

Thank you and best regards,

Ajaar
 

Attachments

  • Master.xlsm
    24.1 KB · Views: 4
Dear Friends,

Looking for a solution for this, would be really thankful to your help.

Regards,
Ajaar
 
Dear Friends,

Looking for a solution for this, would be really thankful to your help.

Regards,
Ajaar
Hi,

I've adjusted all the comboboxes to add consecutive months to each and done the first payment box for you. You should now easily be able to do all the other payment boxes.

Note I updated the conboboxes exactly as requested in your question i.e add 1 month to mmomth2 and 2 to mmonth 3 etc and this completely ignores mmonth1.
 

Attachments

  • Master.xlsm
    26.5 KB · Views: 2
Back
Top