#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default userform

Change
Private Sub CommandButton1_Click()
[a1].Activate

to

Private Sub CommandButton1_Click()
Application.Goto worksheets("LOADSHEET").Range("A1"), True

--
Regards,
Tom Ogilvy

Antonov wrote in message
...
Hello group, and Rick (if you are reading this... thank you!)

I have a problem with a userform and a textbox in this userform.
I use the userform to input data into a worksheet ("LOADPLAN").
What I need is to be able to see the data of a cell in a different

worksheet
("LOADSHEET" I53) in a textbox in the userform. How can I do it?

Below you will find all the formulas that are in the userform.


Private Sub CommandButton1_Click()
[a1].Activate
findvalue = UCase(ComboBox4.Value)
If Not ActiveSheet.UsedRange.Find(findvalue, lookat:=xlWhole,
matchcase:=True) Is Nothing Then
ActiveSheet.UsedRange.Find(findvalue, lookat:=xlWhole,
matchcase:=True).Activate
Else
MsgBox "The Position could not be found"
Exit Sub
End If
With ActiveCell
If Right(findvalue, 1) = "L" Then
If .Offset(-1, 0).Value = "" Then
If ActiveSheet.UsedRange.Find
(ComboBox2.Value, lookat:=xlWhole)
Is Nothing Then
.Offset(-2, 0) = ComboBox2.Value
Else
MsgBox "Pallet already in use"
Exit Sub
End If
.Offset(-4, 0) = ComboBox1.Value
.Offset(-3, 0) = TextBox1.Value
.Offset(-1, 0) = TextBox2.Value
Else
MsgBox "Position is already taken"
Exit Sub
End If
Else
If .Offset(1, 0).Value = "" Then
If ActiveSheet.UsedRange.Find
(ComboBox2.Value, lookat:=xlWhole)
Is Nothing Then
.Offset(3, 0) = ComboBox2.Value
Else
MsgBox "Pallet already in use"
Exit Sub
End If
.Offset(1, 0) = ComboBox1.Value
.Offset(2, 0) = TextBox1.Value
.Offset(3, 0) = ComboBox2.Value
.Offset(4, 0) = TextBox2.Value
Else
MsgBox "Position is already taken"
Exit Sub
End If
End If
End With
TextBox1.Value = ""
ComboBox1.Value = ""
TextBox2.Value = ""
ComboBox2.Value = ""
ComboBox3.Value = ""
ComboBox4.Value = ""
End Sub




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default userform

Hello Tom. Thanks for your reply.
There is a problem in the formula you gave me. The userform I use is in
another sheet. Your formula opens a different worksheet then the one I need
to put the data in and this creates an error (in fact the data does not find
its destination). That's why I need to create a textbox or whatever that can
report the value in "LOADSHEET!I53".

"Tom Ogilvy" wrote in message
...
Change
Private Sub CommandButton1_Click()
[a1].Activate

to

Private Sub CommandButton1_Click()
Application.Goto worksheets("LOADSHEET").Range("A1"), True

--
Regards,
Tom Ogilvy

Antonov wrote in message
...
Hello group, and Rick (if you are reading this... thank you!)

I have a problem with a userform and a textbox in this userform.
I use the userform to input data into a worksheet ("LOADPLAN").
What I need is to be able to see the data of a cell in a different

worksheet
("LOADSHEET" I53) in a textbox in the userform. How can I do it?

Below you will find all the formulas that are in the userform.


Private Sub CommandButton1_Click()
[a1].Activate
findvalue = UCase(ComboBox4.Value)
If Not ActiveSheet.UsedRange.Find(findvalue, lookat:=xlWhole,
matchcase:=True) Is Nothing Then
ActiveSheet.UsedRange.Find(findvalue, lookat:=xlWhole,
matchcase:=True).Activate
Else
MsgBox "The Position could not be found"
Exit Sub
End If
With ActiveCell
If Right(findvalue, 1) = "L" Then
If .Offset(-1, 0).Value = "" Then
If ActiveSheet.UsedRange.Find
(ComboBox2.Value, lookat:=xlWhole)
Is Nothing Then
.Offset(-2, 0) = ComboBox2.Value
Else
MsgBox "Pallet already in use"
Exit Sub
End If
.Offset(-4, 0) = ComboBox1.Value
.Offset(-3, 0) = TextBox1.Value
.Offset(-1, 0) = TextBox2.Value
Else
MsgBox "Position is already taken"
Exit Sub
End If
Else
If .Offset(1, 0).Value = "" Then
If ActiveSheet.UsedRange.Find
(ComboBox2.Value, lookat:=xlWhole)
Is Nothing Then
.Offset(3, 0) = ComboBox2.Value
Else
MsgBox "Pallet already in use"
Exit Sub
End If
.Offset(1, 0) = ComboBox1.Value
.Offset(2, 0) = TextBox1.Value
.Offset(3, 0) = ComboBox2.Value
.Offset(4, 0) = TextBox2.Value
Else
MsgBox "Position is already taken"
Exit Sub
End If
End If
End With
TextBox1.Value = ""
ComboBox1.Value = ""
TextBox2.Value = ""
ComboBox2.Value = ""
ComboBox3.Value = ""
ComboBox4.Value = ""
End Sub






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UserForm FSt1 Excel Worksheet Functions 0 February 26th 09 02:00 AM
UserForm CR Excel Discussion (Misc queries) 1 August 10th 05 10:26 PM
UserForm Help Jennifer Excel Discussion (Misc queries) 1 April 6th 05 10:57 AM
userform Antonov Excel Programming 1 September 2nd 03 04:25 AM
Userform John Wilson Excel Programming 2 August 1st 03 06:33 PM


All times are GMT +1. The time now is 10:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"