Thread: open worksheet
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default open worksheet

option explicit
sub testme01()

dim wkbk as workbook
dim wksName as string

wksname = activesheet.range("a1").value

set wkbk = workbooks.open(filename:=c:\filename.xls")

on error resume next
application.goto wkbk.worksheets(wksname).range("a1"), scroll:=true
if err.number < 0 then
beep
err.clear
end if

end sub



Benjamin wrote:

Is there a way to open a specific worksheet based on the contents of a cell
in the source worksheet..

Workbooks.Open Filename:="C:\filename.xls#(worksheet name in A1)!A1"

TIA

Ben


--

Dave Peterson