Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically set current active worksheet to myWorksheet

Status
Not open for further replies.

ljCharlie

IS-IT--Management
Apr 21, 2003
397
US
Is there a way to automatically detect the worksheet name of a workbook? Here's what I want to do.

Dim myWorksheet As Worksheet

Now, I want to Set myWorksheet to the currently active worksheet. How do I do this?

Help is appreciated.

ljCharlie
 
What about this ?
Set myWorksheet = ActiveWorksheet

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks but that doesn't work. I got an error saying variable not defined on the word "ActiveWorkSheet"

ljCharlie
 
Thanks! I found it. It's ActiveSheet and not ActiveWorkSheet.

ljCharlie
 
Sorry for the typo:
Set myWorksheet = ActiveSheet

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top