Results 1 to 10 of 11

Thread: write permanently to another sheet from a cell with formulated lookup value

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Jul 2012
    Posts
    10
    Rep Power
    0
    Quote Originally Posted by Admin View Post
    Hi

    Try

    Code:
    Private Sub Worksheet_Change(ByVal Target As Range)
        
        If Target.Address(0, 0) <> "J1" Then Exit Sub
        
        Dim LookupValueRow  As Variant
        
        Const DestSheet     As String = "Sheet2"    '<<<<< adjust to suit
        Const ColA_StartRow As Long = 5             '<<<<< adjust to suit
        
        If Len(Target) Then
            LookupValueRow = WorksheetFunction.Match(Target, Range("a:a"), 0)
            If Not IsError(LookupValueRow) Then
                Worksheets(DestSheet).Cells(LookupValueRow - ColA_StartRow + 1, "BL") = Range("D32").Value
            End If
        End If
            
    End Sub
    again it writes in sheet2 column BL 2nd row(BL2) when lookupvalue (ie J1) is given "2"
    but since "2"(J1) is in columnA row3 in sheet2 output should be in BL3
    Last edited by ajish002; 08-19-2012 at 12:29 PM.

Similar Threads

  1. Replies: 2
    Last Post: 03-21-2013, 10:38 PM
  2. Lookup From Cell Range By Matching Row and Column
    By paul_pearson in forum Excel Help
    Replies: 2
    Last Post: 03-07-2013, 02:02 PM
  3. Replies: 1
    Last Post: 02-10-2013, 06:21 PM
  4. Concatenate Multiple Lookup Values in Single Cell
    By Admin in forum Download Center
    Replies: 4
    Last Post: 04-06-2012, 09:07 PM
  5. Split Cell and Lookup
    By bsiq in forum Excel Help
    Replies: 4
    Last Post: 11-21-2011, 10:03 PM

Posting Permissions

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