+ Reply to Thread
Results 1 to 4 of 4

Adding info if LCase(Target.Value) = (Excel 2003)

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Adding info if LCase(Target.Value) = (Excel 2003)

    I have the following code but I need to add the following to it:

    If Not Intersect(Target, Range("X:X")) Is Nothing Then
    If Target.Cells.Count = 1 Then ' stops the code looping
    If LCase(Target.Value) = "termination n/a" Then
    Cells(Target.Row, 17).Value = "001"
    ' ALSO copy the text in Cells(Target.Row, 13) then Paste it to Cells(Target.Row, 18) and add /001 after the text
    Range("X" & Target.Row).ClearContents
    End If
    End If
    End If
    Could someone help me?

    ---------- Post added at 01:12 PM ---------- Previous post was at 01:04 PM ----------

    The idea:

    If the user selects "termination n/a" from column X:X then it will add 001 to column Q Then will copy the info from column M and paste it in Column R adding /001 to the end of the text.

  2. #2
    Registered User
    Join Date
    01-01-2005
    MS-Off Ver
    2007
    Posts
    368

    Re: Adding info if LCase(Target.Value) = (Excel 2003)

    I not sure what you want but I hope it helps...

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        If Not Intersect(Target, Range("X:X")) Is Nothing Then
            If Target.Cells.Count = 1 Then ' stops the code looping
                If LCase(Target.Value) = "termination n/a" Then
                    Cells(Target.Row, 17).Value = "001"
                    ' ALSO copy the text in Cells(Target.Row, 13) then Paste it to Cells(Target.Row, 18)
                    ' and add /001 after the text
                    Cells(Target.Row, 13).Copy Cells(Target.Row, 18)
                    Cells(Target.Row, 18) = Cells(Target.Row, 18) & "001"
                    Range("X" & Target.Row).ClearContents
                End If
            End If
        End If
    End Sub
    Elio Fernandes

  3. #3
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: Adding info if LCase(Target.Value) = (Excel 2003)

    It adds the "001" to column Q but it doesnt add the text from Column M & add /001.

    I would to figure out the following:

    If (Target, Range("X:X")) = LCase(Target.Value) = "termination n/a" Then
    As an example I will take Row 5

    If Cell M = Testing and If Cell X = termination n/a is selected then
    Add 001 to Cell Q and
    add the text from Cell M therefore "Testing" add /001 making Cell R to equal "Testing/001"
    Then Clear Cell X.


    I have a formula within the same page doing exacly what I need but I can't figure out how to put it togetter:

    .Formula = "=A$" & .Row & "&""/""&TEXT(ROW()-" & .Row - 1 & ",""000""""/HS"""""")"

  4. #4
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: Adding info if LCase(Target.Value) = (Excel 2003)

    Any help/tricks would be appreciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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