Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Compile error in Userform macro

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Compile error in Userform macro

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" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Compile error in Userform macro

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" wrote in message
...
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
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
Password Protect Macro - Compile Error Teddy-B Excel Discussion (Misc queries) 1 January 23rd 08 02:50 AM
Macro Compile Error Marvin Excel Programming 1 August 29th 06 06:10 PM
Macro / Compile Error / Duplicate Declaration carl Excel Worksheet Functions 1 June 29th 05 08:55 PM
macro compile error Jan Holmstrom Excel Programming 3 June 9th 05 01:46 PM
MVP Challenge. Erratic Userform Compile Error Seb[_3_] Excel Programming 8 December 20th 03 06:51 PM


All times are GMT +1. The time now is 08:38 PM.

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"