Thread: Set ws
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Karen53 Karen53 is offline
external usenet poster
 
Posts: 333
Default Set ws

Hi,

I have two workbooks open and I am trying to set wsOld to a sheet in the old
workbook. OldShName is a string variable containing the sheet code name of
the sheet I'm trying to set. I keep getting an error stating an object is
required. Is it because I am trying to use a string? Is there a way to do
this?

wbkOld.Activate

If OldShName = "" Then
Set wsOld = ActiveSheet
Else
Set wsOld = Sheets(OldShName.Name)
End If


--
Thanks for your help.
Karen53