Hello,
I am new to this forum and new to Visual Basic.
I need someone to point me in the right direction.
I have been asked to write a spreadsheet (which I have done) and then use a macro which will run everytime the file is opened, which will only allow the user to access the spreadsheet 10 times.
This is what I have so far.
-----------------------------------------------
Dim counter As Integer
Sub Auto_open()
'
' Macro to limit use of spreadsheet to 10 times
'
counter = 10
If counter > 0 Then
userResponse = MsgBox("this application is limited to 10 uses. You have <counter> uses remaining", vbOKOnly, "Warning")
'I don't know what the format is for showing the counter value is.
counter = counter - 1
'When counter = 0, do not allow access to spreadsheet
Else end programme and block user from opening spreadsheet
End Sub
Apologies if this is not the correct place to ask this question.
Many thanks
Aston
I am new to this forum and new to Visual Basic.
I need someone to point me in the right direction.
I have been asked to write a spreadsheet (which I have done) and then use a macro which will run everytime the file is opened, which will only allow the user to access the spreadsheet 10 times.
This is what I have so far.
-----------------------------------------------
Dim counter As Integer
Sub Auto_open()
'
' Macro to limit use of spreadsheet to 10 times
'
counter = 10
If counter > 0 Then
userResponse = MsgBox("this application is limited to 10 uses. You have <counter> uses remaining", vbOKOnly, "Warning")
'I don't know what the format is for showing the counter value is.
counter = counter - 1
'When counter = 0, do not allow access to spreadsheet
Else end programme and block user from opening spreadsheet
End Sub
Apologies if this is not the correct place to ask this question.
Many thanks
Aston
Comment