Consulting

Results 1 to 3 of 3

Thread: Solved: Auto Populate Cell With Text

  1. #1
    VBAX Tutor
    Joined
    Oct 2012
    Posts
    298
    Location

    Solved: Auto Populate Cell With Text

    Hi, I wonder someone may be able to help me please.

    I'm using the code below to populate cells with text, giving instructions to the user on whether they need to manully enter, or select a value from a drop down menu.

    [vba]If Target.Column = 9 Then
    If Target.Value = "E" Then
    Target.Offset(, 1).Value = "Enter the EN Number"
    End If
    End If[/vba]
    I'd now like to extend this a little further and amend the code so that it looks in two columns i.e. 'Target.Column = 9 and 10', and checks for the values 'E' in column 9 and '>0' in column 10.

    The offset will then be 'Target.Offset(, 1).Value="Enter the description"' from column 10.

    I just wondered whether someone could possibly look at this please and offer some guidnace on how I may go about adapting my original code to look at the values in two columns.

    Many thanks and kind regards

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    this may help you understand a bit further[VBA]
    If Target.Column = 9 Then
    If Target.Value = "E" AND Target.Offset(0,1).Value >0 Then
    Target.Offset(, 1).Value = "Enter the description from column 10"
    End If
    End If
    [/VBA]
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    VBAX Tutor
    Joined
    Oct 2012
    Posts
    298
    Location
    Hi @Simon Lloyd, thank you for taking the time to read my post and send the solution.

    It's exactly what I was after!

    Many thanks and kind regards

Posting Permissions

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