Next open row

  • My users keep getting the same window "Resolve Conflicts" I know its related to the same row being populated with data i just dont know how to modify the VBA.. i need to except all data and have the entry occupy the next open row..thank you


    Private Sub saveclose_Click()
    Dim ssheet As Worksheet
    Set ssheet = ThisWorkbook.Sheets("sheet1")
    nr = ssheet.Cells(Rows.Count, 1).End(-4162).Row + 1
    ssheet.Cells(nr, 1) = Me.TBDate
    ssheet.Cells(nr, 2) = Me.CmbListItem
    ssheet.Cells(nr, 3) = Me.TBUser
    ssheet.Cells(nr, 4) = Me.ComboListItem2
    ThisWorkbook.Save
    ThisWorkbook.Close
    Application.Quit
    End Sub

  • Re: Next open row


    Thank you.. but it seems to still only populate one entry.. myself and another user enter data simultaneously and when i reopen the workbook it only displays one record.. how can i have it display both entries?

  • Re: Next open row


    Hi, patel,


    Excel2013 shows -4162 as the equivalent of xlUp - any explanations from your expertise for a better understanding from my side?


    Ciao,
    Holger

  • Re: Next open row


    Hi, JoeHelpexcel,


    the cod eyou posted seems to work fine -w emay only test with samples we created and will differ from you original workbook. Assuming the textboxes and ComboBoxes are filled you would need to elaborate if you want to close the workbook (then you can´t quit Excel as the macro stops right when the workbook is closed) or quit Excel as well.



    Ciao,
    Holger

  • Re: Next open row


    I need the combo box and text box entries to populate on the designated sheet and have the workbook close and save automatically for each user.. for some reason i cant get multiple entries to save because of a same row occupied error.. can you hlp?

  • Re: Next open row


    Hi, JoeHelpexcel,


    the code posted here should do okay for a single entry from each control - I don´t get the idea why you are talking about multiple entries being saved on the same row. Can you please elaborate or attach a sample workbook?


    Ciao,
    Holger

  • Re: Next open row


    Its a shared workbook where multiple users can enter data collected on sheet1.. for some reason that i dont understand, when 2 users enter data simultaneously only one user entry appears.. cant figure out how to attach the doc on this site

  • Re: Next open row


    Hi, JoeHelpexcel,


    maybe try using a boolean variable to determine whether a user has started to write data and disable the button for all other users for the time until the process is finished (any relational database will deliver this behaviour as a standard without the other disadvantages of a sheared workbook).


    Ciao,
    Holger

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!