Excel Make conditional formmating appear as a list in a cell -
i have dataset , have 2 extreme numbers use conditonal formatting work out if numbers in data set dont fit criteria, in formula use below.
=or(b3<$e$8,b3>$e$7)
im wondering way of making list of cells dont fit criteria appear list, in cell.
for example, if had list of 1,2,3,4,5,6,7,8,9 , 2 numbers 3 , 7 fromula gerneate output:
1,2,8,9
enter following user defined function in standard module:
public function makealist(rng range, u long, l long) string dim r range, s string each r in rng if r.value < l or r.value > u s = s & "," & r.value end if next r makealist = mid(s, 2) end function
and use range of values:
note:
the first argument range of values.
the second argument upper limit.
the third argument lower limit.
user defined functions (udfs) easy install , use:
- alt-f11 brings vbe window
- alt-i alt-m opens fresh module
- paste stuff in , close vbe window
if save workbook, udf saved it. if using version of excel later 2003, must save file .xlsm rather .xlsx
to remove udf:
- bring vbe window above
- clear code out
- close vbe window
to use udf excel:
=makealist(a1:a100,b1,c1)
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
and specifics on udfs, see:
http://www.cpearson.com/excel/writingfunctionsinvba.aspx
macros must enabled work!
Comments
Post a Comment