vba - Activating hidden sheet within workbook Excel 2010 -


i have summary sheet called 'summary' has link on it. link goes following sub:

sub wtbutton() call gotoworksheet("wilmington") end sub 

as can see, calls sub called gotoworksheet. looks this:

sub gotoworksheet(strworksheet string) on error goto err_gotoworksheet worksheets("summary")    if worksheets(strworksheet).visible = xlsheethidden       worksheets(strworksheet).visible = xlsheetvisible    end if     worksheets(strworksheet).activate  end  exit_gotoworksheet:    exit sub  err_gotoworksheet:    msgbox err.description, vbcritical, "gotoworksheet error"    resume exit_gotoworksheet  end sub 

i want sheet remain hidden until end user ready add data it. whole system works great if sheet visible. if sheet hidden, not make visible , not activate it.

what doing wrong?

link file: https://www.dropbox.com/s/wsv9al410m7kwda/book1test.xlsm

not tested should work...

sub gotoworksheet(strworksheet string)   on error goto err_gotoworksheet   worksheets(strworksheet)      if .visible = xlsheethidden         .visible = xlsheetvisible      end if      .activate   end  exit_gotoworksheet:    exit sub  err_gotoworksheet:    msgbox err.description, vbcritical, "gotoworksheet error"    resume exit_gotoworksheet  end sub 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -