If <> equal to named list require user to fill out desired columns?

  • Thread starter Thread starter Matt Pierringer
  • Start date Start date
M

Matt Pierringer

I have a named list of part numbers. I already have conditional
formatting on the cells in column A to test if it is equal to any of
the part numbers in the list. If it is not equal to the list it will
change colors to green signifying that it is adding a new part number
to the database. I would like to require the user to fill out the
next 7 columns and leave the rest to be optional.
I am grateful for any suggestions!

Thanks,
Matt
 
Assuming that the cell containing the active part is the ActiveCell:

'Test for new item
If ActiveCell.Interior.Color = vbGreen Then
ActiveCell.Offset(0, 1) = InputBox("Enter data", "Column B")
ActiveCell.Offset(0, 2) = InputBox("Enter data", "Column C")
ActiveCell.Offset(0, 3) = InputBox("Enter data", "Column D")
ActiveCell.Offset(0, 4) = InputBox("Enter data", "Column E")
ActiveCell.Offset(0, 5) = InputBox("Enter data", "Column F")
ActiveCell.Offset(0, 6) = InputBox("Enter data", "Column G")
ActiveCell.Offset(0, 7) = InputBox("Enter data", "Column H")
End If

This is psuedo code only to give you an idea of how it can be done.
 
Assuming that the cell containing the active part is the ActiveCell:

'Test for new item
If ActiveCell.Interior.Color = vbGreen Then
ActiveCell.Offset(0, 1) = InputBox("Enter data", "Column B")
ActiveCell.Offset(0, 2) = InputBox("Enter data", "Column C")
ActiveCell.Offset(0, 3) = InputBox("Enter data", "Column D")
ActiveCell.Offset(0, 4) = InputBox("Enter data", "Column E")
ActiveCell.Offset(0, 5) = InputBox("Enter data", "Column F")
ActiveCell.Offset(0, 6) = InputBox("Enter data", "Column G")
ActiveCell.Offset(0, 7) = InputBox("Enter data", "Column H")
End If

This is psuedo code only to give you an idea of how it can be done.

Well... thanks, but since it is only a conditional formatting that is
setting the color, vb did not recognize it as "vbGreen" which actually
I had to change ".Interior.Color = vbGreen" to ".Font.ColorIndex =
10"(I tested 10 with two other cells with vb to determine that was in
fact the correct color #). I think the problem is that conditional
formatting does not actually set those properties, hence you can not
test for them. Any other ideas?

Thanks,
Matt Pierringer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top