Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
NEW USER WOULD LIKE HELP WITH A COUPLE OF PROBLEMS
NEW USER WOULD LIKE HELP WITH A COUPLE OF PROBLEMS
I'd like some help with these problems 1) I want to get a command button on a userform in sheet 1 to close sheet 1 then open sheet 2 and point to a command button on that sheet called MenuButton which will then open a userform on sheet 2 called ClientForm I've done this in the workbook code Private Sub MenuButton_Click() Dim ClientForm As UserForm ClientForm.Show MenuButton.Show End Sub And this in the userform code on sheet 1 Option Explicit 'declaring a form level variable shtProductAdd as a worksheet Dim shtProductAdd As Worksheet 'this is for worksheet 1 Dim shtClientAdd As Worksheet 'this is for sheet 2 Private Sub ClientButton2_Click() Dim Fiddling As Workbook Dim MenuButton As CommandButton Me.Hide Dim shtClientAdd As Worksheet Set shtClientAdd = Workbooks("Fiddling").Worksheets("clients") MenuButton.Show End Sub It doesn't work 2)Next - I want to get a command button on sheet 2's userform called SummaryButton to open a userform on sheet 3 called SummaryForm I've tried this - Private Sub SummaryButton_Click() Me.Hide SummaryForm.Show End Sub On the userform on sheet 2 As you can guess Im good at getting things to work. This one does open the userform But on sheet 2 3) Next I've put a list box on the userform on sheet 2 I've used this code to enter some items in it In the userform initialize I've put And I've put this on the useform code as well - ; big help that Private Sub ListBox1_Click() Dim ListBox1 As ListBox 'select ............default list box 'lstBox1.ListIndex = 0 ListBox1.AddItem "M&M's plain (500g)" ListBox1.AddItem "M&M's peanut (500g)" ListBox1.AddItem "Cadbury Cherry Ripe Bars (300g)" ListBox1.AddItem "Cadbury Twirl Bars (300g)" ListBox1.AddItem "Cadbury Caramello Bars (300g)" ListBox1.AddItem "Cadbury Snack Bars (300g)" ListBox1.AddItem "Cadbury Peppermint Bars (300g)" ListBox1.AddItem "Cadbury Hazelnut Bars (300g)" End Sub As usual I'm good at getting things to work NOTHING DISPLAYS ................funny that 4) And also I've got a text box on the sheet2 userform with this code Private Sub TextBox1_Change() Dim TextBox1 As String Dim iRow As Long Dim iCol As Long Dim shtClientAdd As Worksheet Set shtClientAdd = _ Application.Workbooks("Fiddling").Worksheets("clie nts") TextBox1 = TextBox With shtClientAdd iRow = .Cells(.Rows.Count, "A").End(xlUp). _ Offset(1, 0).Row iCol = .Cells(1, .Columns.Count).End(xlToLeft). _ Offset(0, 1).Column End With End Sub Which surprisingly goes no where and after entering data there Nothings on the sheet and a completely independent so far uncoded Command button on that form becomes highlighted I would greatly appreciate help |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
NEW USER WOULD LIKE HELP WITH A COUPLE OF PROBLEMS
Can you not just use something like:
Sheet2.Select Userform2.show ?? wrote in message ups.com... NEW USER WOULD LIKE HELP WITH A COUPLE OF PROBLEMS I'd like some help with these problems 1) I want to get a command button on a userform in sheet 1 to close sheet 1 then open sheet 2 and point to a command button on that sheet called MenuButton which will then open a userform on sheet 2 called ClientForm I've done this in the workbook code Private Sub MenuButton_Click() Dim ClientForm As UserForm ClientForm.Show MenuButton.Show End Sub And this in the userform code on sheet 1 Option Explicit 'declaring a form level variable shtProductAdd as a worksheet Dim shtProductAdd As Worksheet 'this is for worksheet 1 Dim shtClientAdd As Worksheet 'this is for sheet 2 Private Sub ClientButton2_Click() Dim Fiddling As Workbook Dim MenuButton As CommandButton Me.Hide Dim shtClientAdd As Worksheet Set shtClientAdd = Workbooks("Fiddling").Worksheets("clients") MenuButton.Show End Sub It doesn't work 2)Next - I want to get a command button on sheet 2's userform called SummaryButton to open a userform on sheet 3 called SummaryForm I've tried this - Private Sub SummaryButton_Click() Me.Hide SummaryForm.Show End Sub On the userform on sheet 2 As you can guess Im good at getting things to work. This one does open the userform But on sheet 2 3) Next I've put a list box on the userform on sheet 2 I've used this code to enter some items in it In the userform initialize I've put And I've put this on the useform code as well - ; big help that Private Sub ListBox1_Click() Dim ListBox1 As ListBox 'select ............default list box 'lstBox1.ListIndex = 0 ListBox1.AddItem "M&M's plain (500g)" ListBox1.AddItem "M&M's peanut (500g)" ListBox1.AddItem "Cadbury Cherry Ripe Bars (300g)" ListBox1.AddItem "Cadbury Twirl Bars (300g)" ListBox1.AddItem "Cadbury Caramello Bars (300g)" ListBox1.AddItem "Cadbury Snack Bars (300g)" ListBox1.AddItem "Cadbury Peppermint Bars (300g)" ListBox1.AddItem "Cadbury Hazelnut Bars (300g)" End Sub As usual I'm good at getting things to work NOTHING DISPLAYS ................funny that 4) And also I've got a text box on the sheet2 userform with this code Private Sub TextBox1_Change() Dim TextBox1 As String Dim iRow As Long Dim iCol As Long Dim shtClientAdd As Worksheet Set shtClientAdd = _ Application.Workbooks("Fiddling").Worksheets("clie nts") TextBox1 = TextBox With shtClientAdd iRow = .Cells(.Rows.Count, "A").End(xlUp). _ Offset(1, 0).Row iCol = .Cells(1, .Columns.Count).End(xlToLeft). _ Offset(0, 1).Column End With End Sub Which surprisingly goes no where and after entering data there Nothings on the sheet and a completely independent so far uncoded Command button on that form becomes highlighted I would greatly appreciate help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
HELP WITH A COUPLE OF SIMPLE FORMULAS FOR A NEW USER | Excel Programming | |||
CountIF with multiple criteria... couple of problems driving me nuts, help? | Excel Worksheet Functions | |||
Problems with user created command bar | Excel Programming | |||
New user with a couple of questions.... | Excel Discussion (Misc queries) | |||
Problems with User-defined Function | Excel Programming |