PDA

View Full Version : Solved: Auto Populate Cell With Text



hobbiton73
12-01-2012, 08:53 AM
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.

If Target.Column = 9 Then
If Target.Value = "E" Then
Target.Offset(, 1).Value = "Enter the EN Number"
End If
End If
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

Simon Lloyd
12-01-2012, 12:11 PM
this may help you understand a bit further
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

hobbiton73
12-02-2012, 06:12 AM
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