NEW USER WOULD LIKE HELP WITH A COUPLE OF PROBLEMS

R

rlashmore999

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("clients")
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
 
C

Corey

Can you not just use something like:
Sheet2.Select
Userform2.show

??


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("clients")
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top