right click and refresh
-
Hi, I am using input boxes to enter data into a spreadsheet. But my problem is that if the user makes an error then they can't go back. This is partly because after the user has input the data my code puts their data into variable and then does various calculations with it before putting the result into defined cells. Does anyone know how I could put in a user update if they right click the cell where they have made an error? The new data would then have to be refrshed through the rest of the code. Heres an example of some of the code Private Sub Workbook_Open() Dim mydate As Date Dim baldate As Date Dim duedate As Date Dim todate As Date Dim TheDate As Date ' Declare variables. Dim Msg Dim hey Dim Ms Dim instal Dim instmon Dim mon mydate = Date ActiveSheet.Cells(15, 1).Value = mydate rentac = Application.InputBox(Prompt:="Enter rent account number", Default:="1234567", Type:=1) tenant = Application.InputBox(Prompt:="Enter name of tenant", Default:="Tenant", Type:=2) adda = Application.InputBox(Prompt:="Enter house no and street, eg 1 Walnut Street", Default:="1 Walnut Street", Type:=2) addb = Application.InputBox(Prompt:="Enter name of Town, eg Prudhoe", Default:="Prudhoe", Type:=2) AddEx = Application.InputBox(Prompt:="Enter additional address lines, eg Hexham", Default:="Prudhoe", Type:=2) addc = Application.InputBox(Prompt:="Enter name of County, eg Northumberland", Default:="Northumberland", Type:=2) addd = Application.InputBox(Prompt:="Enter postcode, eg NE42 123", Default:="NE42 123") bal = Application.InputBox(Prompt:="Enter opening balance", Default:="100.0", Type:=1) baldate = Application.InputBox(Prompt:="Enter date at which balance applies", Default:="17-06-01", Type:=1) duedate = Application.InputBox(Prompt:="Enter first charge date eg usually Monday coming ", Default:="18-06-01", Type:=1) todate = Application.InputBox(Prompt:="Enter last charge date if different from end of year ", Default:="31-03-02", Type:=1) rent = Application.InputBox(Prompt:="Enter weekly rent", Default:="45.00", Type:=1) ActiveSheet.Cells(13, 1).Value = "Ref" & rentac ActiveSheet.Cells(81, 2).Value = rentac ActiveSheet.Cells(17, 1).Value = "Dear " & tenant ActiveSheet.Cells(51, 1).Value = tenant ActiveSheet.Cells(52, 1).Value = adda ActiveSheet.Cells(53, 1).Value = addb ActiveSheet.Cells(54, 1).Value = AddEx ActiveSheet.Cells(55, 1).Value = addc ActiveSheet.Cells(56, 1).Value = addd ActiveSheet.Cells(25, 2).Value = baldate ActiveSheet.Cells(25, 8).Value