excel - If No Picture match then show msg box -


i have code below works guy's have code im not sure how do. 'got match: sample of pic vast folder - show msg box if no match found. possible without switching code much?

private sub rejecttitlenm_change()      dim f range, v      v = me.rejecttitlenm.value      ' find selected value in source range colb(rejecttitle)     set f = range("rejecttitle").find(v, lookat:=xlwhole)      me.textbox1.text = ""      if not f nothing         ' got match: value colc(issue) on same row         me.textbox1.text = f.entirerow.cells(, "c").value         ' got match: value cold(ta) on same row         me.textbox2.text = f.entirerow.cells(, "d").value         ' got match: value cole(vba) on same row         me.textbox3.text = f.entirerow.cells(, "e").value          ' reject id         ' got match: value cola(rejectid) on same row         me.rejectid.text = f.entirerow.cells(, "a").value          ' channels         ' got match: value colf(mail) on same row         me.mailchannel.text = f.entirerow.cells(, "f").value         ' got match: value colg(web) on same row         me.webchannel.text = f.entirerow.cells(, "g").value         ' got match: value colg(phone) on same row         me.phonechannel.text = f.entirerow.cells(, "h").value           ' got match: sample of pic reject folder         rejectsamples.image2.picture = loadpicture(thisworkbook.path & "\rejectexamples\" & rejecttitlenm.value & ".jpg")          ' got match: sample of pic vast folder         vexamples.vastex.picture = loadpicture(thisworkbook.path & "\vastscreens\" & rejecttitlenm.value & ".jpg")     end if  end sub 

private sub rejecttitlenm_change()      dim f range, v      v = me.rejecttitlenm.value                                  ' search value      set f = range("rejecttitle").find(v, lookat:=xlwhole)       ' search rejecttitle (column b)      me.textbox1.text = ""      if not f nothing                                    ' update userform data in same row           me.textbox1.text = f.entirerow.cells(, "c").value       ' issue (column c in "found" row)         me.textbox2.text = f.entirerow.cells(, "d").value       ' ta         me.textbox3.text = f.entirerow.cells(, "e").value       ' vba          me.rejectid.text = f.entirerow.cells(, "a").value       ' rejectid          ' channels         me.mailchannel.text = f.entirerow.cells(, "f").value    ' mail         me.webchannel.text = f.entirerow.cells(, "g").value     ' web         me.phonechannel.text = f.entirerow.cells(, "h").value   ' phone           ' sample of pic reject folder         rejectsamples.image2.picture = loadpicture(thisworkbook.path & "\rejectexamples\" & rejecttitlenm.value & ".jpg")          ' sample of pic vast folder         vexamples.vastex.picture = loadpicture(thisworkbook.path & "\vastscreens\" & rejecttitlenm.value & ".jpg")      else          msgbox "please check input", vbexclamation, "no match found"      end if  end sub 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -