Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003

    Unanswered: Get an instance of a sheet from codename string?

    I have a lookup that returns a string Code name of a wks say sheet3

    is there a way I can get a worksheet object referencing sheet3 from a string?

    something like

    Dim wks as worksheet
    wks = activeworkbook.sheetsFromCodeName("Sheet3") ?

  2. #2
    Join Date
    Apr 2009
    I think you're saying that you will have a variable that (using a lookup) contains the sheet name as a string, so you want something like:

    Dim wks as Worksheet
    wks = ActiveWorkbook.Sheets(VariableHoldingSheetName)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts