Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional Formatting
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Conditional formatting--different formatting depending on cell con | Excel Discussion (Misc queries) | |||
Formatting Conditional Formatting Icon Sets | Excel Discussion (Misc queries) | |||
Formatting cells in a column with conditional formatting? | Excel Discussion (Misc queries) | |||
Protect Cell Formatting including Conditional Formatting | Excel Discussion (Misc queries) | |||
Conditional Formatting that will display conditional data | Excel Worksheet Functions |