LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
ARB ARB is offline
external usenet poster
 
Posts: 2
Default Newbie Help

When i make a userform with listbox ... i want to load default values
that if the user just hits the button, any values he didn't change get
loaded into the appropriate cells. Any value he changes will overwrite
the default.

Problem is i am getting erratic results with the following:

If the user "tabs" through the fields... all is well...

If the user just hits the button... only some of the values are
updated... others are null/empty.

And to top it off, it seems Inconsistant as to which of the six values
are updated.

I'm probably just overlooking something simple, and any help would be
appreciated.

Andrew Blair
---------------------------------------
sample code follows:
---------------------------------------


Private Sub CommandButton1_Click()
Range("a1") = ListBox1.Value
Range("a2") = ListBox2.Value
Range("a3") = ListBox3.Value
Range("a4") = ListBox4.Value
Range("a5") = ListBox5.Value
Range("a6") = ListBox6.Value

End Sub

Private Sub UserForm_Click()

End Sub

Private Sub UserForm_Initialize()
ListBox1.List = Array("a", "b", "c")
ListBox2.List = Array("1", "2", "3", "4", "5", "6", "7", "8", "9",
"10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20",
"21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31")
ListBox3.List = Array("03", "04")
ListBox4.List = Array("1", "2", "3", "4", "5", "6", "7", "8", "9",
"10", "11", "12")
ListBox5.List = Array("1", "2", "3", "4", "5", "6", "7", "8", "9",
"10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20",
"21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31")
ListBox6.List = Array("03", "04")

ListBox1.Text = "a"
ListBox2.Text = "20"
ListBox3.Text = "03"
ListBox4.Text = "5"
ListBox5.Text = "2"
ListBox6.Text = "03"
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
[newbie] Jon Excel Discussion (Misc queries) 3 March 29th 09 10:10 AM
newbie lena Excel Worksheet Functions 5 February 6th 09 03:36 PM
Please help Newbie Bblatz Excel Worksheet Functions 1 April 23rd 08 09:21 AM
Real Newbie newbie question Dave New Users to Excel 0 January 10th 07 07:55 PM
Help for a newbie? rehr0001 Excel Worksheet Functions 4 August 18th 05 05:13 AM


All times are GMT +1. The time now is 11:49 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"