VBA countif

nd272

New Member
Joined
Jun 10, 2019
Messages
6
Hi hope all is well.

I have a dilemma with a vba project I built. I work in finance and have built a logon system with vba and works perfectly provided there is data there for the person.

I can’t post the code here because of the business I work in. Essentially providing there is data in the applications sheet it in turn customizes a set of graphs and also selects filters on two different pivot tables as well.

Essentially my code works for what I want but I need to address the last item for all in one solution. Do I use something like a countif first before code executes to check if the name is there and if it isn’t it doesn’t try open the sheets. In total I have three sheets I would need to do this on.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Not much to go on there. Sounds like you need to ascertain whether or not data exists, so maybe

If Len(Application.VLookup(parameters)) & vbNullString > 0 Then ...?
 
Upvote 0
Not much to go on there. Sounds like you need to ascertain whether or not data exists, so maybe

If Len(Application.VLookup(parameters)) & vbNullString > 0 Then ...?
Thanks for responding really appreciate it. I will try remove confidential info from the code I have and upload it. Essentially I have coded logon name and password for 30 staff. Before the code executes and logs them in I want to do a check to see if data appears in one or both sheets and show the data accordingly. If no data is found in either then workbook closes (I have the code for this part).
 
Upvote 0

Forum statistics

Threads
1,214,861
Messages
6,121,973
Members
449,059
Latest member
oculus

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