Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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.... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Value NOT being input
Never mind sussed it out.
Had a Custom value infront of the Numerical value, therefore the xlWhole did not find it. "Corey" wrote in message ... 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.... |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Value NOT being input
Now it is NOT working ???
"Corey" wrote in message ... 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.... |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Value NOT being input
after you do the .find, you'll want to test to see if you actually found the
value set rngfound = .find..... if rngfound is nothing then 'what should happen, msgbox, exit sub, beep??? else 'do the real work end if Corey wrote: Now it is NOT working ??? "Corey" wrote in message ... 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.... -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to input pictures automatically based on cell input? | Excel Worksheet Functions | |||
input in number form is being multiplied by 1000 when i input. | Excel Discussion (Misc queries) | |||
Have user input converted to uppercase in same cell as input? | New Users to Excel | |||
=SUMIF(Input!H2:H718,AZ19,Input!E2:E685)AND(IF | Excel Worksheet Functions | |||
CODE to select range based on User Input or Value of Input Field | Excel Programming |