View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Max via OfficeKB.com Max via OfficeKB.com is offline
external usenet poster
 
Posts: 1
Default A Login Macro, (Inputbox & MsgBox)..Need help with a counter.

Hi,

i written a macro where an inputbox retrives the user's name,
and then a welcome msg to the user is then displayed in a msgbox..

The names of the user's who enter their name in this login inputbox,
is compiled into row1 of a spreadsheet...

i was wondering if anyone could help tell me how i could,
take the data entry and ensure it doesnt repeat itself while it adds
to the rows...
example :- if the the macro below is used and the name Tim is used
3 times, it will appear from cell a1-a3 in the spreadsheet..

i was wondering how i could make it so that the names wont be repeated,
and a counter can be added on the next row of each name entry.

Basically i want my macro to be able to compile a list of users and the
number of times they logged in... not having duplicate entries as well..

could someone view my coding below n advice?

thanks awhole lot..!

__________________________________________________ ____________

Sub Login()
Dim Msg, Response
Dim Name As String

Name = InputBox("Enter Your Name")
Msg = "Welcome " & Name
Response = MsgBox(Msg)


Row = 1
ThisCell = Sheets("sheet1").Cells(Row, 1)
Do While ThisCell < ""
Row = Row + 1
ThisCell = Sheets("sheet1").Cells(Row, 1)
Loop
Sheets("sheet1").Cells(Row, 1) = Name

End Sub