excel - Warn the User of empty cell and indicate the location based on values in preceding columns -


i new vba. have problem believe simple, failing foolishly. have generate msgbox warning user enter data in blank cells.

i have mention destination of blank cell indicating parameters in preceding column. excel list big, however, image uploaded demonstrates needs.

in column have entered name of companies - ferrari, audi , lamborghini, while in column b have mentioned respective cars. in column c,d,e have mentioned sales figure months. if user fails enter sales figure 1 entry, need warn him when checks data validity.

the message image should : please enter number of units of lamborghini aventador , lamborghini veneno sold.

in image, yellow highlight indicates data not entered. in file have on 1 column ( 1 month) sales, thousands of rows (for cars).

snapshot image

let's data looks this

enter image description here

try this

private sub commandbutton1_click()     dim ws worksheet     dim lrow long, long      set ws = thisworkbook.sheets("sheet3")      ws         lrow = .range("a" & .rows.count).end(xlup).row          = 4 lrow             if application.worksheetfunction.counta(.range("c" & & ":e" & i)) <> 3                 msgbox "please enter number of units of " & .range("b" & i).value & " sold"                 exit sub             end if         next     end      msgbox "data validated" end sub 

this when run code

enter image description here

and when filled

enter image description here


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -