Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default How to assign a worksheet in VBA

Subject: How to assign a worksheet in VBA
I have declared following:
Dim wsDec As Worksheet

Now I am doing this
Set wsDec = ActiveWorkbook.wsDecoupling

Where wsDecoubling is a worksheet in my workbook, but I get an error
Object does not support this property or method, what is the correct way to refer to a sheet in a wokbook in VBA.

Thanks,


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default How to assign a worksheet in VBA

Try

Set wsDec = ActiveWorkbook.Sheets("wsDecoupling")

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default How to assign a worksheet in VBA

On Saturday, September 22, 2012 10:36:38 AM UTC-4, (unknown) wrote:
Subject: How to assign a worksheet in VBA I have declared following: Dim wsDec As Worksheet Now I am doing this Set wsDec = ActiveWorkbook.wsDecoupling Where wsDecoubling is a worksheet in my workbook, but I get an error Object does not support this property or method, what is the correct way to refer to a sheet in a wokbook in VBA. Thanks,


Ben:
Thanks a lot for answering my naive quetsions. Really appreciate your help.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default How to assign a worksheet in VBA

Happy to help.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assign variable to a worksheet ? MAS Excel Programming 3 September 20th 06 08:25 PM
Help!! copy worksheet and assign a name to new worksheet. Steven Excel Programming 1 November 14th 05 02:22 PM
Assign a worksheet name to a variable benjammind[_4_] Excel Programming 3 July 11th 05 11:16 AM
assign onkey to 1 worksheet short_n_curly[_2_] Excel Programming 5 July 1st 05 05:23 PM
assign value to cell in another worksheet tango Excel Programming 2 October 15th 04 06:18 AM


All times are GMT +1. The time now is 04:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"