Hi,
Does anyone no why code just starts running when it shouldnt. I wanted to delete a row on one of my sheets but when I did the combo on that sheet ran its code which resulted in an a vb error? The code on my combobox is:
Private Sub ComboBox1_Click()
Dim vRange
Dim LastCell As Long
Sheet1.Rows("11:65536").Delete
Sheet3.Select
'Range("M3:P3").AutoFilter 4, Me.ComboBox1
vRange = Array("A3", "D3", "H3")
For i = LBound(vRange) To UBound(vRange)
Sheet3.Range(vRange(i)).Select
Do
ActiveCell.Offset(1, 0).Select
Loop While ActiveCell.EntireRow.Hidden = True
Sheet3.Range(ActiveCell, Sheet3.Cells(65536, ActiveCell.Column).End(xlUp)).Select
Selection.Copy
Select Case i
Case 0
Sheet1.Range("B11").PasteSpecial xlPasteValues
Case 1
Sheet1.Range("C11").PasteSpecial xlPasteValues
End Select
Next i
End Sub
Does anyone no why code just starts running when it shouldnt. I wanted to delete a row on one of my sheets but when I did the combo on that sheet ran its code which resulted in an a vb error? The code on my combobox is:
Private Sub ComboBox1_Click()
Dim vRange
Dim LastCell As Long
Sheet1.Rows("11:65536").Delete
Sheet3.Select
'Range("M3:P3").AutoFilter 4, Me.ComboBox1
vRange = Array("A3", "D3", "H3")
For i = LBound(vRange) To UBound(vRange)
Sheet3.Range(vRange(i)).Select
Do
ActiveCell.Offset(1, 0).Select
Loop While ActiveCell.EntireRow.Hidden = True
Sheet3.Range(ActiveCell, Sheet3.Cells(65536, ActiveCell.Column).End(xlUp)).Select
Selection.Copy
Select Case i
Case 0
Sheet1.Range("B11").PasteSpecial xlPasteValues
Case 1
Sheet1.Range("C11").PasteSpecial xlPasteValues
End Select
Next i
End Sub