BeforeSave. Help needed Before Madness.

darro

Board Regular
Joined
Mar 10, 2009
Messages
208
I have this code. It doesnt work. Presumably I am missing something obvious but I don't know what. Any ideas would br very appreciated.

Code:
Private Sub Workbook_BeforeSave (ByVal SaveAsUi As Boolean, Cancel As Boolean)

Dim ARCN As Range
Set ARCN = Range("user_details")
Dim ARCD As Range
Set ARCD = Range("logged")

user = Application.InputBox("name"), ("user details")
If user = False Then
Exit Sub

Else


ARCN = user
ARCD = Date

End If

    MsgBox " user details entered "

Range("A1").Select

End Sub


Any ideas? Thanks for any help.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Code:
user = Application.InputBox("name", "user details")
Is your InputBox line in red?? If yes then this should help!!!



I think that is the only problem rest everything seems good to me.
 
Last edited:
Upvote 0
Hi. Thanks for your reply. That is my typing error. That line reads:

user= Application.InputBox("name", "user details")


Any other ideas.

When I save it just saves. No input box appears at all

Thanks for your help
 
Upvote 0

Forum statistics

Threads
1,224,568
Messages
6,179,595
Members
452,927
Latest member
whitfieldcraig

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