View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
StumpedAgain StumpedAgain is offline
external usenet poster
 
Posts: 192
Default Conditional Formatting

I resorted to the following. It's longer, but easier to copy/paste than an
if/then.

Select Case curselection.Value
Case "Company1"
curselection.Copy Range("A7").Offset(i + j, 0)
Case "Company2"
curselection.Copy Range("A7").Offset(i + j, 0)
Case "Company3"
curselection.Copy Range("A7").Offset(i + j, 0)
Case "Company4"
curselection.Copy Range("A7").Offset(i + j, 0)
etc.
End Select



"StumpedAgain" wrote:

I have a list of products that I want to search for in my later program with
titles distinguishing the different manufacturers within the table (example
below). The manufacturers won't change any time soon and I want to make an
If Then statement that says: If selection is company A or company B etc. then
copy selection and paste in a certain cell. Because I know the
manufacturers, I was hoping to stear clear of having another list that I have
to loop through to see if Company A = Comapny A in another list or (almost
worse) have a large If Then imbedded statement that has 15 If Then's to match
the number of Companies. Any thoughts? Much thanks in advance!


Company A
Product 1
Product 2
Company B
Product 5
Product 6
etc.