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: 1
Default Excel VBA - Multi sheet filtering/querying(?) & combo box woes

Hi People!

Easy one first - ;) , UserForm will not initialize on loading, unles
user hits the Clear Form button first. But doing that appends ye
another list to the combo boxes. Driving me nuts, and I'll bet th
solution is staring me in the face

Slightly more difficult one now - ;)
I need to be able to sort through the sheets and return to a cell i
the "Totals" sheet, a value for the number of Entrants paying for mor
than one round. I have a column in each sheet containing the number
(1, 2, or 3) they have paid for.

Code follows::
------------------------------------------------
Private Sub cmdClear_Click()
Call frmInput_Initialize
End Sub
------------------------------------------------
Private Sub cmdExit_Click()
ActiveWorkbook.Sheets("Totals").Activate
Unload Me
End Sub

------------------------------------------------

Private Sub cmdUpdate_Click()
'Set appropriate worksheet as active for input
If optMod = True Then
ActiveWorkbook.Sheets("Modified").Activate
ElseIf optSupSedan = True Then
ActiveWorkbook.Sheets("SuperSedan").Activate
ElseIf optModBike = True Then
ActiveWorkbook.Sheets("ModBike").Activate
ElseIf optStBike = True Then
ActiveWorkbook.Sheets("StreetBike").Activate
ElseIf optStreet = True Then
ActiveWorkbook.Sheets("Street").Activate
ElseIf optJun = True Then
ActiveWorkbook.Sheets("Junior").Activate
ElseIf optBurn = True Then
ActiveWorkbook.Sheets("Burnout").Activate
End If
'Find the next empty row for input
Range("A3").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
'Add data from form to worksheet row
ActiveCell.Value = txtName.Value
ActiveCell.Offset(0, 1) = txtNum.Value
ActiveCell.Offset(0, 2) = cboPay.Value
ActiveCell.Offset(0, 3) = txtAmount.Value

If optOne = True Then
ActiveCell.Offset(0, 4).Value = "1"
ElseIf optTwo = True Then
ActiveCell.Offset(0, 4).Value = "2"
ElseIf optThree = True Then
ActiveCell.Offset(0, 4).Value = "3"
End If
If optBurn = True Then
ActiveCell.Offset(0, 5) = cboBurn.Value
End If

'Call msgbox to see if any more input desired
Dim Msg, Style, Title, Response
' Define messagebox content.
Msg = "Entry Added - Do you want to add another entry ?"
Style = vbYesNo ' Define buttons.
Title = "Add Another Entry?" ' Define title.

Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then ' User chose Yes.
Call frmInput_Initialize ' Restart the form
Else ' User chose No.
Call cmdExit_Click ' Kill the form
End If


End Sub
-----------------------------------------------

'Set up the form for input
Private Sub frmInput_Initialize()
'Clear all text inputs
txtName.Value = ""
txtNum.Value = ""
txtAmount.Value = ""
'Set up the comboboxes
With cboPay
.AddItem "Cash"
.AddItem "Cheque"
.AddItem "Credit Card"
.AddItem "Bank Transfer"
End With
With cboBurn
.AddItem "4 Cyl"
.AddItem "6 Cyl"
.AddItem "8 Cyl"
End With
'Set some defaults
cboPay.Value = "Cash"
cboBurn.Value = ""
optOne.Value = True
optMod.Value = True
txtName.SetFocus

End Sub
-------------------------------------------

Private Sub UserForm_Click()

End Sub
-------------------------------------------

End code.

Thanks in advance

Do

--
Message posted from http://www.ExcelForum.com

 
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
Multi core and pivot table woes SuperStretch Excel Discussion (Misc queries) 0 January 29th 08 10:02 PM
Querying an excel sheet Jay Excel Discussion (Misc queries) 0 January 12th 05 08:41 AM
Multi Column Combo Box Tom Ogilvy Excel Programming 0 December 9th 03 09:44 PM
Multi Column Combo Box Rob Bovey Excel Programming 0 December 9th 03 09:21 PM
Populating Sheet Data From A UserForm Combo Box Enabled For Multi-Choices R3df1sh[_3_] Excel Programming 1 December 4th 03 08:58 PM


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