View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rpettis31 Rpettis31 is offline
external usenet poster
 
Posts: 49
Default Value not matching

I am running a loop to obtain values on a change event yet I can not seem to
obtain that value from the sheet I am looking at the values are returning a
blank?

Private Sub Worksheet_Change(ByVal Target As Range)

Dim x As Integer

If Target.Address = "$C$13" Then
ItemNum = Target.Value

Sheets("Data").Select

For x = 1 To 10

If Cells(x, 1) = ItemNum Then
Desc = Cells(x, 2)
StdCost = Cells(x, 3)
Spec = Cells(x, 6)
End If

Next x

Sheets("Justification - working").Select

Cells(13, 4) = Desc
Cells(13, 6) = StdCost
Cells(13, 5) = Spec
End If

End Sub