excel - VBA Dialog box to select range in different workbook -
i want allow user select range in different workbook.
i have attempted inputbox("",type:=8) works select data in workbook refuses allow me select range in different workbook.
hence dialog box allows me perform task.
since free, created example you
create userform , place combobox, refedit control , label

next paste code in userform
private sub userform_initialize() dim wb workbook '~~> name of workbooks in combobox each wb in application.workbooks combobox1.additem wb.name next combobox1 = activeworkbook.name end sub '~~> lets toggle between open workbooks private sub combobox1_change() if combobox1 <> "" application.workbooks(combobox1.text).activate label1.caption = "": refedit1 = "" end sub '~~> , lets choose relevant range private sub refedit1_change() label1.caption = "" if refedit1.value <> "" _ label1.caption = "[" & combobox1 & "]" & refedit1 end sub this when run userform



Comments
Post a Comment