Results 1 to 3 of 3

incorporate variable into VB code

Threaded View

  1. #1
    Registered User
    Join Date
    09-20-2005
    MS-Off Ver
    Office Pro 2016
    Posts
    7

    Question incorporate variable into VB code

    Need some help with proper VB syntax, please. I regularly create a Pivot Table that is created from a worksheet which has been copied from the previous week's worksheet. After copying the previous week's worksheet, I give it a new tab name, then create the Pivot Table, from new date entered into the worksheet.

    1. I'd like to assign the new worksheet tab name to a variable. Does the assignment statement include "wrksht.name"? What is the proper syntax to assign the current worksheet's tab name to a variable?

    2. Then, since creating a Pivot Table requires the specific worksheet tab name be included in the VB code itself, I'd like to plug the value of that variable (the current worksheet's tab name) into a line of VB code that I use to create the Pivot Table, so the Pivot Table will use the data in the current worksheet, and not the data from the previous week. How does that literal get inserted into the VB code, so I won't need to go into the VB Editor regularly to update the VB code itself manually, to reflect the current worksheet's tab name.

    Thanks for your help.
    Last edited by itsthebike; 09-20-2005 at 11:55 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1