vba - Excel copy range to keep hidden rows -


as question states, anyway copy/paste range , copy hidden rows too?

currently use

xlwb.sheets("template").range(template_rfull_inc).copy thisworkbook.sheets(test_name).range("a11")     application.displayalerts = false     .pastespecial xlpastecolumnwidths     .pastespecial xlpastevalues, , false, false     .pastespecial xlpasteformulas, , false, false     .pastespecial xlpasteformats, , false, false     .pastespecial xlpastevalidation     application.cutcopymode = false     application.displayalerts = true end 

is code like

.pastespecial xlhiddenrows 

if long winded or going cause headache have work around

if want same lines hidden in copy (test_name), have run else after copy. closed should work.

dim toproworiginal long dim toprowcopy long toproworiginal = template_rfull_inc.row toprowcopy = thisworkbook.sheets(test_name).range("a11").row dim r range each r in range(template_rfull_inc).rows     thisworkbook.sheets(test_name).rows(r.row + toprowcopy - 1).entirerow.hidden = r.entirerow.hidden next r 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -