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

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: 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





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 Freshman Excel Worksheet Functions 4 November 9th 06 01:04 PM
Userform Help in VBC Marcia3641 Excel Discussion (Misc queries) 1 July 23rd 05 12:10 AM
UserForm Help Jennifer Excel Discussion (Misc queries) 1 April 6th 05 10:57 AM
Userform John Wilson Excel Programming 2 August 1st 03 06:33 PM
Userform RboinD Excel Programming 1 August 1st 03 02:42 PM


All times are GMT +1. The time now is 12:02 AM.

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"