If statement to hide/show rows in Excel VBA -


i have sequence of code if c37 blank, want 2 series of rows hidden. code have works this.

however,

if d37 not blank same series of rows unhidden.

'show/hide filter index columns  if worksheets("req sheet").range("c37").value = ""    worksheets("formulation").rows("54:57").entirerow.hidden = true    worksheets("formulation").rows("125:128").entirerow.hidden = true else     rows("54:57").entirerow.hidden = false     rows("125:128").entirerow.hidden = false  end if  if worksheets("req sheet").range("c38").value = ""    worksheets("formulation").rows("54:57").entirerow.hidden = true    worksheets("formulation").rows("125:128").entirerow.hidden = true else     rows("54:57").entirerow.hidden = false     rows("125:128").entirerow.hidden = false  end if 

i know have syntax of code wrong, problem getting second portion of code c38 supersede code from c37.

i have tried using , operator couldn't achieve success!

thanks help!

with worksheets("req sheet")      if .range("c37").value <> "" or .range("c38").value <> ""         worksheets("formulation").rows("54:57").entirerow.hidden = false         worksheets("formulation").rows("125:128").entirerow.hidden = false     else         worksheets("formulation").rows("54:57").entirerow.hidden = true         worksheets("formulation").rows("125:128").entirerow.hidden = true          rows("54:57").entirerow.hidden = false         rows("125:128").entirerow.hidden = false     end if  end 

Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -