#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 210
Default Login

Hello guys

I need help creating a macro that would act as a login form for the workbook.
the macro would validate the id and password from another workbook.
Can anyone please help me with this?

Thanks and Regards
Robin
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Login

sub CheckLogin

PassWordFName = "C:\MyFolder\Password.xls"

Account = inputBox("Enter Account : ")
PassWd = inputbox("Enter Password : ")

'Open Password File
set PassWdBk = workbooks.open(filename:=PassWordFName)
with PassWdBk.Sheets("Sheet1")
set CheckAccnt = .Columns("A").Find _
(what:=Account,lookin:=xlvalues,lookat:=xlwhole)
if CheckAccnt is nothing then
msgbox("Did not find account")
else
OldPassword = CheckAccnt.offset(0,1).value 'get password from col B
if PassWd = OldPassword then
msgbox("Password Matched")
else
msgbox("Password did not match")
end if
end if
end with

PassWdBk.close savechanges:=False
end sub

"Robin" wrote:

Hello guys

I need help creating a macro that would act as a login form for the workbook.
the macro would validate the id and password from another workbook.
Can anyone please help me with this?

Thanks and Regards
Robin

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Login Name - VBA Sri Excel Programming 1 October 24th 05 07:01 PM
Login System Jim Thomlinson[_4_] Excel Programming 1 July 14th 05 02:40 AM
Login Help!!! TMO[_6_] Excel Programming 1 February 8th 04 03:09 PM
Login Box help Bill Lunney Excel Programming 0 August 20th 03 11:45 AM
Login Box Tom Ogilvy Excel Programming 0 August 8th 03 01:42 PM


All times are GMT +1. The time now is 03:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"