+ Reply to Thread
Results 1 to 2 of 2

How to automate with macro multiworksheet File using array variable?

  1. #1

    How to automate with macro multiworksheet File using array variable?

    I created a file with multiple Worksheets and defined an Array:

    Dim arrRtTab(1 To 12) As String

    arrRtTab(1) = "MS"
    arrRtTab(2) = "MW"
    arrRtTab(3) = "MM"
    arrRtTab(4) = "MU"
    arrRtTab(5) = "MDS3"
    arrRtTab(6) = "XS"
    arrRtTab(7) = "XN"
    arrRtTab(8) = "QN"
    arrRtTab(9) = "QE"
    arrRtTab(10) = "QS"
    arrRtTab(11) = "NS"
    arrRtTab(12) = "LI"

    How can I access tabs of the file as variables for copy and paste
    operation in my macro?
    I need to copy from tab "LI" to tab"MS" or another tab pending results
    of other computations.

    Georgee


  2. #2
    JMB
    Guest

    RE: How to automate with macro multiworksheet File using array variabl

    where x and y are your source and destination ranges, you should be able to do:

    Worksheets(arrRtTab(12)).Range(x).Copy Worksheets(arrRtTab(1)).Range(y)

    "[email protected]" wrote:

    > I created a file with multiple Worksheets and defined an Array:
    >
    > Dim arrRtTab(1 To 12) As String
    >
    > arrRtTab(1) = "MS"
    > arrRtTab(2) = "MW"
    > arrRtTab(3) = "MM"
    > arrRtTab(4) = "MU"
    > arrRtTab(5) = "MDS3"
    > arrRtTab(6) = "XS"
    > arrRtTab(7) = "XN"
    > arrRtTab(8) = "QN"
    > arrRtTab(9) = "QE"
    > arrRtTab(10) = "QS"
    > arrRtTab(11) = "NS"
    > arrRtTab(12) = "LI"
    >
    > How can I access tabs of the file as variables for copy and paste
    > operation in my macro?
    > I need to copy from tab "LI" to tab"MS" or another tab pending results
    > of other computations.
    >
    > Georgee
    >
    >


+ Reply to Thread

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