Compile Error Case Without Select Case
Contents |
Forums Excel Questions vba case without select case Compile Error Results 1 to 4 compile error end select without select case of 4 vba case without select case Compile ErrorThis is
Compile Error Expected Case
a discussion on vba case without select case Compile Error within the Excel Questions forums, compile error next without for part of the Question Forums category; I'm having problems implementing a Select Case statement. Keep getting case without select case at Case condition2. Need help. compile error next without for excel vba Thanks ... LinkBack LinkBack URL About LinkBacks Bookmark & Share Digg this Thread!Add Thread to del.icio.usBookmark in TechnoratiTweet this thread Thread Tools Show Printable Version Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Apr 25th, 2013,08:16 PM #1 simora Board Regular Join Date May 2005 Posts 198
End Select Without Select Case Error
vba case without select case Compile Error I'm having problems implementing a Select Case statement. Keep getting case without select case at Case condition2. Need help. Thanks Code: Select Case Condition Case condition1 If Cells(rsRow, rsCol).Value = "" Then Cells(rsRow, rsCol) = TextBox2.Value Case condition2 If Cells(rsRow, rsCol).Value > 0 And iVal = 1 Then Cells(rsRow, rsCol).Select ActiveCell.Offset(1).EntireRow.Insert ActiveCell.Offset(1, 0).Value = TextBox2.Value Case condition3 If Cells(rsRow, rsCol).Value > 0 And iVal > 1 Then ActiveCell.Offset(1, 0).Value = TextBox3.Value Case Else MsgBox "Case Else : The Code DID NOT Execute " ActiveCell.Offset(1, 0).Value = TextBox4.Value End Select Share Share this post on Digg Del.icio.us Technorati Twitter Reply With Quote Apr 25th, 2013,08:26 PM #2 JoeMo MrExcel MVP Join Date May 2009 Posts 12,712 Re: vba case without select case Compile Error In the condition2 part try changing this: ActiveCell.Offset(1).EntireRow.Insert to this: ActiveCell.Offset(1,0).EntireRow.Insert Share Share this post on Digg Del.icio.us Tech
Way | Trading Add-ins For Excel | Convert Excel Into Calculating Web Pages Excel Web Pages | Produce Clean Efficient VBA Code Every Time | Build Automated Trading Models In Excel | Excel Web case vba Pages | Excel Video Training Forum New Posts FAQ Calendar Forum Actions Mark Forums Read Quick Links Today's Posts What's New? Advanced Search Forum HELP FORUMS Excel General Select Case error "Case without Select Case" Excel Training / Excel Dashboards Reports If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register http://www.mrexcel.com/forum/excel-questions/699382-visual-basic-applications-case-without-select-case-compile-error.html link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. If you don't like Google AdSense in the posts, register or log in above. Click here to view the relaunched Ozgrid newsletter. Page 1 of 2 1 2 Last Jump to page: Results 1 to 10 of 18 Thread: Select Case error "Case without Select Case" Thread Tools Show Printable Version Search http://www.ozgrid.com/forum/showthread.php?t=54263 Thread Advanced Search July 20th, 2006 #1 kpfunf View Profile View Forum Posts Senior Member Join Date 14th July 2006 Posts 229 Select Case error "Case without Select Case" For the following code, I'm getting the "Case without Select Case" error (On Case 3 to 5...assuming more are wrong too, but debug can't get there yet). I thought I had it right, obviously don't. Can anyone spot how my code is wrong? VB: Sub Grandfather() Select Case Range("A2").Value 'Performance Scores Case 4.5 To 5 Select Case Range("B2").Value 'Years of Service Case Is > 5 Select Case Range("C2").Value 'Salary Case Is < 1.2 * Range("D2").Value 'Compa Ratio Range("E2").Value = Range("C2").Value Case Else Range("E2").Value = 1.2 * Range("D2").Value Case 3 To 5 Select Case Range("C2").Value 'Salary Case Is < 1.18 * Range("D2").Value 'Compa Ratio Range("E2").Value = Range("C2").Value Case Else Range("E2").Value = 1.18 * Range("D2").Value Case 1 To 2.99 Select Case Range("C2").Value 'Salary Case Is < 1.16 * Range("D2").Value 'Compa Ratio Range("E2").Value = Range("C2").Value Case Else Range("E2").Value = 1.16 * Range("D2").Value Case Is < 1 Select Case Range("C2").Value 'Salary Case Is < 1.15 * Range("D2").Value 'Compa Ratio Range("E2").Value = Range("C2").Value Case Else Range("E2").Value = 1.15 * Range("D2").Value Case 4 To 4.49 Select Case Range("B2").Value 'Years of Service Case Is > 5 Select Case Range("C2").Value 'Sala
Need help? Post your question and get tips & solutions from a community of 418,437 IT Pros https://bytes.com/topic/access/answers/956352-compile-error-end-select-without-select-case & Developers. It's quick & easy. Compile error: End Select without Select Case P: 46 Vasago I am getting a this compile error on line 22 and I do have the Select case and End Select. Expand|Select|Wrap|Line Numbers SelectCase[BookingStatus] Case1 DoCmd.OpenReport"CharterOrderForm",wherecondition:="Bookings.ID='"&Forms![CharterOrderForm]![ID]&"'" Case2 If[Invoice#]=0Then tempinvoiceid=(DMax("Invoice#","Invoices")+1) Setdb=CurrentDb.OpenRecordset("Invoices") db.AddNew db![Invoice#]=(DMax("Invoice#","Invoices")+1) db![Amount]=Me![QuotePrice] db![BilledDate]=Now() db![TripDate]=Me![Date] db![School]=Me.Client db![SchoolID]=Me.[SchoolID] db![Discription]=[NumberofBuses]&_ "Bus(es)From"&[PickupPointName]&_ "To"&[DestinationName] IfTrip_Type="FieldTrip"Then Else db![Route]=-1 EndIf compile error db.Update DoCmd.OpenReport"InvoiceFromCharter",_ wherecondition:="[Invoice#]="&_ tempinvoiceid&"" EndSelect Does it have anything to do with the operations preformed in the cases? Apr 28 '14 #1 Post Reply Share this Question 3 Replies 100+ P: 269 Luk3r This may not be what's causing it... but you are missing an End If for your first If statement. Apr 28 '14 #2 reply Expert without select case 100+ P: 1,204 jimatqsi That most likely is causing it. You'll get an error similar to that whenever you forget a terminator for if/Then, Select Case, For/Next and With/End. Depends which one came first as to what particular error message you see. Jim Apr 28 '14 #3 reply Expert Mod 2.5K+ P: 4,993 zmbd That's the ticket, the "IF" at line 5 doesn't have a matching "End IF" prior to line 26. I've properly "stepped" your code. >HOWEVER< the stepping is based on what you have coded and as related to how the functions relate (ie line 18 thru 21 - even though I'm certain you intended that "else" to be part of the outter if, I stepped it as though it belonged to the closer "if" construct) Apr 29 '14 #4 reply Message Cancel Changes Post your reply Join Now >> Sign in to post your reply or Sign up for a free account. Similar topics COMPILE ERROR LOOP WITHOUT DO wHEN I RUN THE PROGRAM IT SAYS LOOP WITHOUT DO A