excel - Why won't my select case find the value? -



excel - Why won't my select case find the value? -

i have list of parts dashes in them (ex. 1230-921) , find info pertaining part list manipulate. re-create , paste value part worksheet. have drop downwards menu list of parts. have info on 1 sheet sorted part number mentioned before. on sheet come in pn , veiw select stored info info sheet

sub recommend_2() dim somearray(28) variant dim integer dim alt variant = 1 28 alt = worksheets(3).range("b15").value select case alt case "1230-921" worksheets(3).range("c16").copy worksheets(3).range("b5").pastespecial case else msgbox "error" end select next

end sub

this has worked best me far. problem cannot find case , returns 28 errors. have changed dimension variables, range locations whole 9 yards. help welcome new idea.

in summary)

i find part drop downwards menu i able manipulate value within part on list i 28 parts

not sure going on without actual spreadsheet, suggest including alt in error.

alt = worksheets(3).range("b15").value select case alt case "1230-921" worksheets(3).range("c16").copy worksheets(3).range("b5").pastespecial case else msgbox "error: value found was:" & alt end select

excel vba excel-vba select type-mismatch

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -