Macros and worksheets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a formula in a macro to work with worksheets that are named
differently. The formula requires that the name of the worksheet be placed
(i.e. "Wheaton") in the code.

Set ws = wb.Worksheets("Wheaton")

If I want this macro to work with the active worksheet how would I designate
it as the active worksheet.

Set ws = wb.ActiveworkSheet ?

Thanks for your help,
cinvic
 
set ws = wb.activesheet


I have a formula in a macro to work with worksheets that are named
differently. The formula requires that the name of the worksheet be placed
(i.e. "Wheaton") in the code.

Set ws = wb.Worksheets("Wheaton")

If I want this macro to work with the active worksheet how would I designate
it as the active worksheet.

Set ws = wb.ActiveworkSheet ?

Thanks for your help,
cinvic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top