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: 62
Default Input box question

I have a Userform that has an input box and a listbox.

When the User brings up the userform they have an option of picking
something from the listbox or typing in a new value in the inputbox.

What i want to do is if there is a value in the inputbox then it disregards
anything selected in the input box.

Heres my code so far:

Private Sub CommandButton1_Click()
Set wks = Worksheets("Expense Non Amex")
Set wks1 = Worksheets("Expense Amex")

lrA = wks.Cells(Rows.Count, 1).End(xlUp).Row
lrB = wks.Cells(Rows.Count, 2).End(xlUp).Row
lrC = wks.Cells(Rows.Count, 3).End(xlUp).Row
lrE = wks.Cells(Rows.Count, 4).End(xlUp).Row
lrD = wks.Cells(Rows.Count, 5).End(xlUp).Row
wks.Range("A" & lrA + 1) = TextBox1.Text
wks.Range("B" & lrA + 1) = TextBox2.Text
wks.Range("C" & lrA + 1) = TextBox3.Text
wks.Range("E" & lrA + 1) = TextBox4.Text
wks.Range("D" & lrA + 1) = ListBox1.Text

If wks.Range("D" & lrA + 1) = "" Then
wks.Range("D" & lrA + 1) = TextBox5.Text

End If

TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
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
Check Input, into Input box question Les Stout[_2_] Excel Programming 2 June 21st 07 06:37 PM
Input Box Question StGermain Excel Discussion (Misc queries) 2 March 12th 07 05:14 PM
input box question/help Anthony Excel Programming 3 February 27th 07 02:33 PM
Input Box question No Name Excel Programming 1 January 8th 07 03:38 PM
Input box question losmac Excel Programming 0 August 20th 03 10:32 PM


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