View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Corey Corey is offline
external usenet poster
 
Posts: 363
Default Value NOT being input

The below code places valuies from the Sheet-"Data" into the Sheet-"Job card",
BUT, the Highlighted LINE value DOES NOT apear, WHY ??
Removing the 'On Error Resume Next' i get a Object Variable not set error.


Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
UserForm2.Hide
With ActiveWorkbook.Worksheets("Job Card")
..Select
Dim rngFound As Range
' On Error Resume Next
With Worksheets("Data").Range("A:A")
Set rngFound = .Find(What:=UserForm2.ListBox1.Value, After:=.Range("A1"), LookIn:=xlValues,
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, Matchbyte:=False)
Range("B2").Value = ListBox1.Value
Range("B6").Value = rngFound.Offset(0, 4).Value ' <===== Error here !!!
End With
' Preview worksheet to either Print of simply View
ActiveWindow.SelectedSheets.PrintPreview
' Clears all data that was brought in from sheet "InspectionData"
Dim c As Range
For Each c In Sheets("Job Card").UsedRange
If c.Locked = False Then
c.ClearContents
End If
Next
Sheets("NavigationPage").Activate
On Error GoTo 0
End With
Unload Me
Application.ScreenUpdating = True
End Sub

Help ??

Corey....