View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld[_2_] Ron Rosenfeld[_2_] is offline
external usenet poster
 
Posts: 1,045
Default populate cells using select case

On Sun, 9 Sep 2012 02:47:59 -0700 (PDT), wrote:

Hi all,
Another question if anyone can help:
If (for example) i put the text Dress in cell A1, can i put the cost of the Dress in cell B2, if i put the text Trousers in cell A1 can i put the cost of the Trousers in cell B2 etc using a select case statement? I know how to to do this using a miltiple "if" function in the worksheet but i am trying to automate this using select case in a macro and can't get it to work.

Thanks in advance for any help on this.

Taffy


You don't give much information but VLOOKUP would probably be faster.

I'm sure you must have, someplace, a table of Items vs Cost. Just use VLOOKUP in B2 to determine the cost, based on the item in A1

Lookup_value would be A1
Table_array would be the address of your table of item vs cost
Col_index_num would, most likely, be 2
Range_lookup would be FALSE to force an exact match