Macro IF....

ginger_jester

New Member
Joined
Feb 24, 2010
Messages
1
Hey guys (and gals)

I'm writing a simple excel sheet to help my department keep track of work load.

I've got a worksheet with a cell where you input your user name (which has been validated so that you can only enter a valid user name into that cell.)

I have a "log in" button with a macro attached with takes the user to the "home" worksheet. Unfortunatly I'm pretty useless with excel so the macro will "log you in" regardless or wheather there is a user name in this cell or not.

What I want to know is if there is a way to set up a macro so that it will only run if there is data in this perticular cell (B6) so that you can only log in if you know a valid user name.
It would be nice if when you try to log in without a user name the program prompts you for one.

Thanks a lot everyone!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi, welcome to the board.

Yes, this is possible.

Do you have a list of valid usernames somewhere in the file ?
If yes, it is reasonably straightforward to add some code which says, if the value in a particular cell is a valid username, proceed with the rest of the macro, otherwise stop.
 
Upvote 0
Hi and welcome to the board!!!
This is easily done, but I don't see the need for what you're doing.
What is the Goal? Are there users that need to access the WorkBook, but are not allowed to view the "Home" worksheet? When the Book isd opened, you can test for the Network "userName" and allow acces depending on that name!! Once the Name is entered in B6, is that info used elsewhere?

lenze
 
Upvote 0

Forum statistics

Threads
1,214,824
Messages
6,121,783
Members
449,049
Latest member
greyangel23

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