Hi I'm hoping someone can help with this I thought it would be simple but my grasp on vba is very limited, I found the below code online and it works however it deletes the entire row I need to delete from column B:DA based on a number from a cell that I retrieve from a combo box (Drop down form control). It is also requiring the source value which I get from the combo box to be in more than one cell as this code was originally for deleting rows based on multiple values I would prefer just the one with a cell reference would be even better and easier for me to wrap my tiny brain around.
Sub Button4_Click
'
' Button4_Click Macro
'
'
Dim deleteRows As Range
Dim SourceWks As Worksheet, deleteWks As Worksheet
Set SourceWks = Sheet 6
Set deleteWks = Sheet 1
With SourceWks
data = .Range(.Cells(1, 1), .Cells(1, 1).End(xlDown))
End With
Set deleteRows = deleteWks.Rows(data(1, 1))
For i = 2 To Ubound(data, 1)
Set deleteRows = Union(deleteRows, deleteWks.Row(data(I, 1)))
Next i
deleteRows.Delete Shift:=xlUp
End Sub
Thanks to anyone in advance
Heath
Sub Button4_Click
'
' Button4_Click Macro
'
'
Dim deleteRows As Range
Dim SourceWks As Worksheet, deleteWks As Worksheet
Set SourceWks = Sheet 6
Set deleteWks = Sheet 1
With SourceWks
data = .Range(.Cells(1, 1), .Cells(1, 1).End(xlDown))
End With
Set deleteRows = deleteWks.Rows(data(1, 1))
For i = 2 To Ubound(data, 1)
Set deleteRows = Union(deleteRows, deleteWks.Row(data(I, 1)))
Next i
deleteRows.Delete Shift:=xlUp
End Sub
Thanks to anyone in advance
Heath