Results 1 to 3 of 3

Set Find Value from a Worksheet cell

Threaded View

max57 Set Find Value from a... 01-30-2010, 05:58 PM
StephenR Re: Set Find Value from a... 01-30-2010, 06:49 PM
max57 Re: Set Find Value from a... 01-30-2010, 07:32 PM
  1. #1
    Forum Contributor
    Join Date
    07-11-2009
    Location
    NYC,USA
    MS-Off Ver
    Excel 2007
    Posts
    135

    Set Find Value from a Worksheet cell

    Hello,

    I’m having trouble trying to get a form, once activated;
    - to use a specified cell value (offset from the target cell),
    - to search another sheet for that value,
    - then return values, (offset from the find value),
    - to a series of textboxes.

    Later, if the user if edits any of the textboxes,
    to perform the same procedure, pasting those values in the appropriate cells.

    Private Sub EditPricing_Activate()
    
    Dim FindCell As Range
    Dim LastCell As Range
    Dim FoundCell As Range
    Dim TargetSheet As Worksheet
    Set TargetSheet = ThisWorkbook.ActiveSheet
    
    
        With Worksheets("IngredientLists")
        Set LastCell = .Range("B1").End(xlDown)
        Set FindCell = .Range("B1", LastCell).find(TargetSheet.Cells(0, -6).Value, _
        .Range("B1"), xlValues, xlWhole)
            End With
         
            If Not FindCell Is Nothing Then
            Set FoundCell = FindCell
           
         Me.txt_PurUnitMz.SetFocus
         Me.txt_PurUnitMz.Value = FoundCell.Offset(0, 1)
         Me.txt_PurUnitWT.Value = FoundCell.Offset(0, 8)
         Me.txt_PurUnitCost.Value = FoundCell.Offset(0, 9)
         Me.txt_ConvOrg.Value = FoundCell.Offset(0, 11)
         Me.lbl_LastUpdate = FoundCell.Offset(0, 10)
    
     End If
    
    End Sub

    A workbook is attached for illustration.


    Thanks -
    Mark
    Attached Files Attached Files
    Last edited by max57; 01-30-2010 at 07:32 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1