Locking Rows in Excel -


i add feature excel worksheet. basically, need lock user going next row unless data filled in previous row.

example:

row 7 columns "a" "p" need filled out before user can go row 8

is possible? if so, how?

place following event macro in worksheet code area:

private sub worksheet_selectionchange(byval target range)     if target.row <> 8 exit sub     dim n long     n = application.worksheetfunction.counta(range("a7:p7"))     if n = 16 exit sub     application.enableevents = false     range("a7").select     application.enableevents = true end sub 

because worksheet code, easy install , automatic use:

  1. right-click tab name near bottom of excel window
  2. select view code - brings vbe window
  3. paste stuff in , close vbe window

if have concerns, first try on trial worksheet.

if save workbook, macro saved it. if using version of excel later 2003, must save file .xlsm rather .xlsx

to remove macro:

  1. bring vbe windows above
  2. clear code out
  3. close vbe window

to learn more macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

and

http://msdn.microsoft.com/en-us/library/ee814735(v=office.14).aspx

to learn more event macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm

macros must enabled work!


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -