Search results

  1. Tark221

    Another question

    so when looking at the code i currently have Private Sub CommandButton4_Click() Dim ws As Worksheet Set ws = ActiveWorkbook.Sheets.Add If Len(AddStaff.TextBox1 & vbNullString) > 0 Then ws.Name = AddStaff.TextBox1 End If End Sub Is it this im looking at Set ws =...
  2. Tark221

    Another question

    Ah your star, works great, do u think there is a way when you create a new sheet it takes it from a template?
  3. Tark221

    Another question

    This is my code now - thanks for the quick reply Private Sub CommandButton1_Click() Dim ws As Worksheet Set ws = ActiveWorkbook.Sheets.Add If Len(UserFormName.CommandButton1 & vbNullString) > 0 Then ws.Name = UserFormName.CommandButton1 End If End Sub It says object required but still...
  4. Tark221

    Another question

    Thanks for the quick reply right I have that working using what you mentioned above, thank you btw Private Sub CommandButton1_Click() ActiveWorkbook.Sheets.Add End Sub Now I have a text box on that form is there a way to write say "newsheet" and when i click the button it names the sheet...
  5. Tark221

    Another question

    ooops apologies forgot to mention excel
  6. Tark221

    Another question

    A button on a user form which when clicked will create a new work sheet. This possible? Thanks
  7. Tark221

    Populating drop down boxes

    I'm in VBA and I used to populate drop down boxes by using the control source in properties, but it's been that long I don't know what to write in there anymore, format wise. can anyone help with this? I'm using excel 2003
  8. Tark221

    Form close help please

    Solved **** Private Sub CommandButton1_Click() Unload MainMenu AddAb.Show End Sub Seems to easy lol but yeh it works, i tried unload me ages ago didnt work then i decided to change the order of the code. Thank you for everyones help very grateful
  9. Tark221

    Form close help please

    still cant get this to work, when I click a buttong it opens the new form on the top, but the old form doesn't close really annoying, you would think there would be a simple bit of code.
  10. Tark221

    Form close help please

    Thanks for the replies people Using this code: Private Sub CommandButton1_Click() On Error GoTo CommandButton1_Click_Err DoCmd.OpenForm "UserForm2", acNormal, "", "", , acNormal DoCmd.Close acForm, "UserForm1" CommandButton1_Click_Exit: Exit Sub CommandButton1_Click_Err: MsgBox Error$...
  11. Tark221

    Form close help please

    omg this form is like terminator still no close lol Private Sub CommandButton1_Click() UserForm2.Show DoCmd.Close UserForm1, "frmUserForm1" End Sub This look ok ? Appreciate all the help btw :)
  12. Tark221

    Form close help please

    still cant get it too work, any example code would be helpful?
  13. Tark221

    Form close help please

    Ah yeh forgot about that, what would those arguments be? Sorry just really new to this
  14. Tark221

    Form close help please

    Thanks for the quick reply, I'm fairly new to VBA this is the code I'm using which opens the new form but doesn't close the old form Private Sub CommandButton1_Click() UserForm2.Show DoCmd.Close End Sub
  15. Tark221

    Form close help please

    I hope I havent posted this twice but I basically have a main form with a list of buttons when one button is clicked it opens a new form, how do i make it when the new form appears the main form closes. Thanks
Back
Top Bottom