excel vba - Show or hide a worksheet using a single button -


i have user form single button.

question: possible show or hide worksheet using single button? if code like?

i tried 1 far:

private sub data_button_click()  if data_button.caption = "hidden" worksheets("u").visible = true data_button.caption = "visible" end if  if data_button.caption = "visible" worksheets("u").visible = false data_button.caption = "hidden" end if  end sub 

merge 2 if statements 1 this:

private sub data_button_click()  if data_button.caption = "hidden"     worksheets("u").visible = true     data_button.caption = "visible" elseif data_button.caption = "visible"     worksheets("u").visible = false     data_button.caption = "hidden" end if  end sub 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -