Hi Guys,
Bit stuck on something. Basically I've got a sheet with 3 columns ....
a - the name of a zone ... b and c are two numbers. there are 22 rows in this sheet (say sheet1)
I have another sheet (sheet2) with an unknown number of rows (will change). one of the columns (say F) has a number in it. If this number is between columns B and C in sheet1 then i want sheet2 column D to = sheet1 column a
quite complicated to explain sorry! anyway here's the code i've done but i get object required error at the "Set CheckCells = Sheet.CMDB.UsedRange" line
Sub Location()
Dim INCR As Integer
Dim cells As Range, CheckCells As Range
Set CheckCells = Sheet.CMDB.UsedRange
INCR = 0
A:
For Each cells In CheckCells
INCR = INCR + 1
If Sheet.CMDB("E(INCR)") Or Sheet.CMDB("F(INCR)") Or Sheet.CMDB("G(INCR)") Or Sheet.CMDB("H(INCR)") Or Sheet.CMDB("i(INCR)") > Sheet.SDC_PROD("D(INCR)") < Sheet.SDC_PROD("E(INCR)") Then Sheet.CMDB("D(INCR)") = Sheet.SDC_PROD("A(INCR)")
If INCR = 22 Then GoTo A
Next
End Sub
Bookmarks