Emoncada
05-17-2013, 10:58 AM
I have the following code
Dim Search As String
Dim ws As Worksheet
Dim aCell As Range
Dim i As Long
Set ws = Worksheets("Data")
For i = 1 To 25
If Me.Controls("Combobox" & i).Value = "Shipped" Then
Next i
Else
With ws
Search = Me.Controls("Textbox" & i).Value
Set aCell = .Columns(74).Find(What:=Search, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Not aCell Is Nothing Then
.Rows(aCell.Row).ClearContents
End If
End With
End If
Next i
I have the following layout.
I have 25 textboxes next to a 25 comboBoxes
I want if the Combobox = "Shipped" then Go to Next Combobox
Else
I want it to search textbox value and delete row on sheet, then
loop back to next line.
I keep getting a Compile Error
Next without For
Dim Search As String
Dim ws As Worksheet
Dim aCell As Range
Dim i As Long
Set ws = Worksheets("Data")
For i = 1 To 25
If Me.Controls("Combobox" & i).Value = "Shipped" Then
Next i
Else
With ws
Search = Me.Controls("Textbox" & i).Value
Set aCell = .Columns(74).Find(What:=Search, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Not aCell Is Nothing Then
.Rows(aCell.Row).ClearContents
End If
End With
End If
Next i
I have the following layout.
I have 25 textboxes next to a 25 comboBoxes
I want if the Combobox = "Shipped" then Go to Next Combobox
Else
I want it to search textbox value and delete row on sheet, then
loop back to next line.
I keep getting a Compile Error
Next without For