Hello,
I'm new to VBA, so apologies if this seems a simple one.!
I'm currently working on a stock check spreadsheet which contain a stock list with datasheets numbers (these would be typical numbers, but the cell may contain more than one) and size, and a requirements sheet with a typical datasheet (single value typically but may be more than), and a size.
I have wrote the below:-
What the aim of this is that it would check the datasheet in the initial range against the datasheet on the stock tab. If it finds a match, i want it to check the valve that is offset on both and see if they match and if they do, i want it to pull information from the stock tab (a unique reference to the specific item)
Some sample data would be as follows:-
Sizes - will be inches so 2", 4", etc
Datasheets - will be BA-F01, BA-F02 etc (note these will not be exact matches as one cell may contain more than one)
Unique Reference - SPR-123456-0001, VLV-123456-0002
If you could point me in the right direction; it would be appreciated.
Thanks!
I'm new to VBA, so apologies if this seems a simple one.!
I'm currently working on a stock check spreadsheet which contain a stock list with datasheets numbers (these would be typical numbers, but the cell may contain more than one) and size, and a requirements sheet with a typical datasheet (single value typically but may be more than), and a size.
I have wrote the below:-
Code:
Sub stock_check()
Sheets("Armada").Select
Dim datasheet_armada As Range
Dim datasheet_stock As Range
Set datasheet_armada = Range("ac1:aC6000")
Set datasheet_stock = Sheets("Stock").Range("E1:E6000")
For Each cell In datasheet_armada
If cell.Value Like "*" & datasheet_stock & "*" And (cell.Offset(0, -21).Value = datasheet_stock.cell.Offset(0, 5).Value) Then
cell.Offset(0, 34).Value = datasheet_stock.Cells.Offset(0, -2).Value
End If
Next cell
End Sub
What the aim of this is that it would check the datasheet in the initial range against the datasheet on the stock tab. If it finds a match, i want it to check the valve that is offset on both and see if they match and if they do, i want it to pull information from the stock tab (a unique reference to the specific item)
Some sample data would be as follows:-
Sizes - will be inches so 2", 4", etc
Datasheets - will be BA-F01, BA-F02 etc (note these will not be exact matches as one cell may contain more than one)
Unique Reference - SPR-123456-0001, VLV-123456-0002
If you could point me in the right direction; it would be appreciated.
Thanks!