vb code help - lilst box

B

bkey01

I have a workbook containing multiple list boxes and command buttons.
am trying to write a code that will allow me to direct 2 choices in th
list box to the same sheet but a different cell. Can some please hel
me with the code to do this?

Example of current code:
if listbox1.selected(1) then sheet1.activate
listbox1.selected(1)=false

I need the 2nd item in the list box to go to sheet1 but cell A50 whil
the 1st one needs to go sheet1 A1.

Thanks,
:eek
 
B

Bob Phillips

Do you mean

With ListBox1
Range("A50").Value = .List(.Listindex)
Range("A1").Value = .List(.Listindex-1)
end with

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top