LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Referencing a UserForm

I an trying to pair down my code. Below is and example of some code that I
run outside of UserForm1. In an effort to reduce my file size, is there any
way to eliminate all the "UserForm1" reference?


Sub TextBoxData()

UserForm1.TextBox12.Value = UserForm1.rng(1, 4) & " " & UserForm1.rng(1,
3) ' First and Last Name

UserForm1.TextBox5.Value = Range("AB6")
' No Show Count

If UserForm1.TextBox5.Value = 2 Then
UserForm1.TextBox5.BackColor = &HFFFF&
End If

If UserForm1.TextBox5.Value = 3 Then
UserForm1.TextBox5.BackColor = &HFF&
End If

If UserForm1.TextBox5.Value 3 Then
UserForm1.TextBox5.BackColor = &H80000012
UserForm1.TextBox5.ForeColor = &HFFFFFF
End If

UserForm1.TextBox13.Value = UserForm1.rng(1, 6)
' Date of No Show
UserForm1.TextBox13.Value = Format$(UserForm1.TextBox13.Value, "ddd
dd mmm yy")


UserForm1.TextBox1.Value = UserForm1.rng(1, 7).Text
' Summary Of Conversation

UserForm1.TextBox4.Value = UserForm1.rng(1, 13)
' Date of Contact
UserForm1.TextBox4.Value = Format$(UserForm1.TextBox4.Value, "ddd dd
mmm yy")

UserForm1.TextBox3.Value = UserForm1.rng(1, 14).Text
' Time of Contact
UserForm1.TextBox3.Value = Format$(UserForm1.TextBox3.Value,
"HH:MM")

UserForm1.TextBox7.Value = UserForm1.rng(1, 17)
' Date of 1st Additional Contact Attempt
UserForm1.TextBox7.Value = Format$(UserForm1.TextBox7.Value, "ddd dd
mmm yy")

UserForm1.TextBox6.Value = UserForm1.rng(1, 18).Text
' Time of 1st Additional Contact Attempt
UserForm1.TextBox6.Value = Format$(UserForm1.TextBox6.Value,
"HH:MM")

UserForm1.TextBox9.Value = UserForm1.rng(1, 19)
' Date of 2nd Additional Contact Attempt
UserForm1.TextBox9.Value = Format$(UserForm1.TextBox9.Value, "ddd dd
mmm yy")

UserForm1.TextBox8.Value = UserForm1.rng(1, 20).Text
' Time of 2nd Additional Contact Attempt
UserForm1.TextBox8.Value = Format$(UserForm1.TextBox8.Value,
"HH:MM")

UserForm1.TextBox11.Value = UserForm1.rng(1, 21)
' Date of 3rd Additional Contact Attempt
UserForm1.TextBox11.Value = Format$(UserForm1.TextBox11.Value, "ddd
dd mmm yy")

UserForm1.TextBox10.Value = UserForm1.rng(1, 22).Text
' Time of 3rd Additional Contact Attempt
UserForm1.TextBox10.Value = Format$(UserForm1.TextBox10.Value,
"HH:MM")

UserForm1.TextBox2.Value = UserForm1.rng(1, 11)
' How many rides Canceled

If UserForm1.rng(1, 11).Text < "" Then
UserForm1.TextBox2.Visible = True
UserForm1.Label7.Visible = True
UserForm1.OptionButton10.Value = True
End If


End Sub

 
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
Referencing a UserForm in a Module Patrick C. Simonds Excel Programming 2 September 2nd 09 08:40 PM
Referencing Userform Controls JeremyJ Excel Programming 0 January 10th 09 12:43 AM
Referencing UserForm event in module avi Excel Programming 2 September 2nd 07 05:53 PM
referencing a different tab by referencing a list in the current s Kevin Excel Worksheet Functions 3 July 6th 07 07:57 PM
Looping procedure calls userform; how to exit loop (via userform button)? KR Excel Programming 6 July 27th 05 12:57 PM


All times are GMT +1. The time now is 11:56 PM.

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

About Us

"It's about Microsoft Excel"