PC Review


Reply
Thread Tools Rate Thread

Compile error in Userform macro

 
 
=?Utf-8?B?d2F0a2luY20=?=
Guest
Posts: n/a
 
      7th Nov 2007
The following routine results in a compile error "Next without For"
....any idea why?

Private Sub ComboBox1_Change()
Dim Row As Integer
For Row = 8 To 23
If Sheets("Control data").Cells(Row, 3) = CapDials.ComboBox1.Value
Then
CapDials.ListBox1.AddItem Sheets("Control data").Cells(Row, 4)
Next Row

End Sub
--
Mike Watkins
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      7th Nov 2007
No End If

Private Sub ComboBox1_Change()
Dim Row As Integer
For Row = 8 To 23
If Sheets("Control data").Cells(Row, 3) = _
CapDials.ComboBox1.Value Then
CapDials.ListBox1.AddItem Sheets("Control data").Cells(Row, 4)
End If
Next Row

End Sub


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"watkincm" <(E-Mail Removed)> wrote in message
news:6DCABDEC-9058-406B-B66F-(E-Mail Removed)...
> The following routine results in a compile error "Next without For"
> ...any idea why?
>
> Private Sub ComboBox1_Change()
> Dim Row As Integer
> For Row = 8 To 23
> If Sheets("Control data").Cells(Row, 3) = CapDials.ComboBox1.Value
> Then
> CapDials.ListBox1.AddItem Sheets("Control data").Cells(Row, 4)
> Next Row
>
> End Sub
> --
> Mike Watkins



 
Reply With Quote
 
=?Utf-8?B?d2F0a2luY20=?=
Guest
Posts: n/a
 
      8th Nov 2007
Duh! Thanks Bob
--
Mike Watkins


"Bob Phillips" wrote:

> No End If
>
> Private Sub ComboBox1_Change()
> Dim Row As Integer
> For Row = 8 To 23
> If Sheets("Control data").Cells(Row, 3) = _
> CapDials.ComboBox1.Value Then
> CapDials.ListBox1.AddItem Sheets("Control data").Cells(Row, 4)
> End If
> Next Row
>
> End Sub
>
>
> --
> ---
> HTH
>
> Bob
>
> (there's no email, no snail mail, but somewhere should be gmail in my addy)
>
>
>
> "watkincm" <(E-Mail Removed)> wrote in message
> news:6DCABDEC-9058-406B-B66F-(E-Mail Removed)...
> > The following routine results in a compile error "Next without For"
> > ...any idea why?
> >
> > Private Sub ComboBox1_Change()
> > Dim Row As Integer
> > For Row = 8 To 23
> > If Sheets("Control data").Cells(Row, 3) = CapDials.ComboBox1.Value
> > Then
> > CapDials.ListBox1.AddItem Sheets("Control data").Cells(Row, 4)
> > Next Row
> >
> > End Sub
> > --
> > Mike Watkins

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile error macro is 111K. how do I fix macro =?Utf-8?B?RHJpY29uMQ==?= Microsoft Excel Programming 2 18th Feb 2007 12:39 PM
macro - compile error =?Utf-8?B?anJmZWFnaW5AeWFob28uY29t?= Microsoft Word Document Management 2 15th Mar 2006 09:25 PM
macro compile error =?Utf-8?B?SmFuIEhvbG1zdHJvbQ==?= Microsoft Excel Programming 3 9th Jun 2005 01:46 PM
MVP Challenge. Erratic Userform Compile Error Seb Microsoft Excel Programming 8 20th Dec 2003 06:51 PM
Macro: Compile Error Yannick Microsoft Word New Users 1 27th Jul 2003 05:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:12 PM.