I had a vba code running perfectly fine but after i saved the file and reopened the macro stopped working.
this code below
Private Sub CommandButton8_Click()
Dim sFind As String, rFound As Range
Select Case Me.ProductOrderTable.Value
Case Is <> vbNullString
sFind = Me.ProductOrderTable.Value
With Sheets("ProductTable")
Set rFound = .Cells.Find(what:=sFind, After:=.Cells(1, 1))
If Not rFound Is Nothing Then
rFound.Range(Cells(2), Cells(4)).Select
Selection.ClearContents
Range("B" & ActiveCell.Row).Select
Range("D" & ActiveCell.Row + 1, Cells(Range("B1000000").End(xlUp).Row, 2)).Select
Selection.Copy
Selection.Offset(-1, 0).Select
ActiveSheet.Paste
Range(Selection, Selection.End(xlDown)).Select
Selection.End(xlDown).Select
Range("D" & ActiveCell.Row + 1, Cells(Range("B1000000").End(xlUp).Row, 2)).Select
Selection.ClearContents
End If
End With
Case Else: Exit Sub
End Select
End Sub
Can't figure out for the life of me why..
I went back to previous saved files ( i save after every new change) when I had working codes, and the VBA for that same macro function don't work on there as well. Any assistance would be appreciated.
Thanks in advance.
Note: All my other macros work, just this particular VBA code with this listbox and command button.
Bookmarks