Apply an excel formula but in a VBA instead

brendalpzm

Board Regular
Joined
Oct 3, 2022
Messages
58
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
Platform
  1. Windows
I have this issue, I'm creating a form that must have a specific folio according to previous entries.

I'm creating the form with ActiveX fields, I tried to link a textbox value from a cell where I have a simple excel formula that gives me the folio depending on the prveiously entered data.

This is the formula:
Excel Formula:
="K"&(COUNTIFS(Incidents_Accu!B:B,">="&DATE(YEAR('Input incidents'!F3),1,1),Incidents_Accu!B:B,"<="&DATE(YEAR('Input incidents'!F3),1,1)))+1&"-"&IFERROR(VLOOKUP(H8,'DB_DO NOT MODIFY'!$A$2:$B$5,2,FALSE),"")&(COUNTIFS(Incidents_Accu!B:B,">="&DATE(YEAR('Input incidents'!F3),1,1),Incidents_Accu!B:B,"<="&DATE(YEAR('Input incidents'!F3),1,1),Incidents_Accu!C:C,H8))+1

this folio changes according to other dropdowns

When I linked it to the textbox, it doesn't change fast and sometimes it doesn't change, so I was wondering if there's a way to create that same formula I did to place it in the textbox directly with VBA so I don't have to link it to a cell value.

If you could help me that would be great!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,215,064
Messages
6,122,941
Members
449,094
Latest member
teemeren

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