vba - Excel column range highlighting, and insertion of calculation data -


i have following problem:

i need highlight period of production order start , finish week, through columns - see in header, there lot of production orders.

is possible vba?

second problem:

each production line has time capacity, production minutes should divided chosen production line weekly capacity end of highlighted period.

this need done on button click e.g. vba, or formulas, have no idea place formulas, because whole table , header supposed dynamic - production plan updates weekly.

update:

here's code, inserts formula in order manufacturing period start finish week, need loop through columns , insert formula according following orders start , finish week. , have no idea how that, appreciated :)

sub test()      dim rng, rng2, rng3 range     dim v1, v2 string      x = range("e8")     w = range("e11")     'search column or range     sheets("forecast").range("d:d")              set rng = .find(what:=x, _                             after:=.cells(.cells.count), _                             lookin:=xlvalues, _                             lookat:=xlwhole, _                             searchorder:=xlbyrows, _                             searchdirection:=xlnext, _                             matchcase:=false)             set rng2 = .find(what:=w, _                             after:=.cells(.cells.count), _                             lookin:=xlvalues, _                             lookat:=xlwhole, _                             searchorder:=xlbyrows, _                             searchdirection:=xlnext, _                             matchcase:=false)                      'msgbox rng.offset(0, 1).address                     'msgbox rng2.offset(0, 1).address                     v1 = rng.offset(0, 1).address                    v2 = rng2.offset(0, 1).address              range(v1 & ":" & v2).select             selection.formula = "=e$12/(e$10-e$7)"             selection.numberformat = "0"      end end sub 

example of production plan:

http://postimg.org/image/3vkx0fv5d/ http://s8.postimg.org/cdud4s1o4/stack3.jpg

as highlighting need put in "conditional format". (it's on home ribbon.) select cells column d11 till end of column range needing formula. click conditional format , enter formula:

=and($b11>d$6;$b11<d$7) 

make sure dollar marks in right spots. , set format apply, example fill red. apply formula, made conditional format column d. select cell d11 , click "format painter" button , select whole range want apply formula. done.

update,adding year:

i see 1 year in sheet. i.e. @ top. if start/finish week of other year should added lines start year , finish year. create lines , columns excel date_formats created of formula: creating excel_date_format

then can use same cf before using newly added column , lines in:like if don't hide newly added orange coloured entries


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -